Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i have two projects, ProjControls and ProjForms

ProjControls includes CtrlAddress, which is a group of controls CtrlText (includes the TextBox control, for street, city, and zipcode) and CtrlOptions (includes ComboBox control, for state codes).

ProjForms includes FormCustomer, that uses CtrlAddress inside the form. that's why i need to include ProjControls' dll for ProjForms

ProjForms also includes FormZipcode, and FormCity, etc. which shares similar UI of the FormCustomer.

 

what i want to do is, inside the CtrlAddress, i want to have a button so that by clicking it users can access information for certain zipcode or city.

now i have the problem: I cannot include the reference of ProjForms into ProjControls....

 

i want to see how you handle this issue? should i combine ProjControls and ProjForms together (tha's not what i want to do, because there are reasons for me to group them seperately)

thankx.

Posted
Provided you're dealing with class libraries referencing other projects shouldn't be a problem.

 

no, it complains i cannot link ProjControls to the forms because it will create a loop -- ProjForms already ref ProjControls.

Posted

Even if the devstudio wouldnt complain you still wouldnt want a circular reference:

For instance you have dll A and dll B. Both try to refer to each other. Now the compiler needs B to compile A. But to compile A it would need to have a compiled version of B. It can't create either because each needs the other first.

 

Why do you try to implement the lookup funcitonality in the control. Why not implement it in the forms. You can add an event to the Control that is triggered when the user clicks on the search button: ZipCodeInformationRequested (but give it a better name ;) ). This event can then be handled by the form and it can do the lookup it knows how to do.

This trick will also keep your control lightweight and maybe even easier to re-use ;).

Nothing is as illusive as 'the last bug'.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...