Wayne,
I too have wrestled with the toolbox, and frankly, I
think the design sucks. Perhaps someone will have a
better solution to this problem than I do, but my
conclusion is to avoid using the toolbox unless absolutely
necessary; if a component is unlikly to change, or if it
can't be represented visually by a standard control.
What I would do in the case of your custom textbox is to
add a regular textbox to your form, then edit the sacred
form designer code section of the code by changing the
class that your control instantiates.
Thus:
Friend WithEvents txtMyTextbox As TextBox
Becomes:
Friend WithEvents txtMyTextbox As CyanFocusTextBox
And:
Me.txtMyTextBox = New TextBox
Becomes:
Me.txtMyTextBox = New CyanFocusTextBox
The form designer doesn't seem to mind - at least not for
me so far, and I have implemented this strategy throughout
a large application. While it is a work-around, it beats
playing the toolbox shuffle, or worse yet, going without
a visual design representation of a control.
I suspect Microsoft imagined a highly structured enterprise
development environment. Well, excuse me!
If I have to admit to a more seat-of-the-pants approach to
programming, so be it.
Randy
-----Original Message-----
1. I have created my own class that inherits the textbox
(called itCyanFocusTextBox). I put in some code and some new
properties. Allthis works. I build the dll that contains this class
successfully.
2. I add it to the user controls section of toolbox and
it appears.
3. I add the new CyanFocusTextBoxes to the form and it
all works.
4. The problem comes when I update the class
CyanFocusTextBox in thedll and rebuild it. These updates are not used by the
CyanFocusTextBoxes that I dropped on the form earlier. I
have todelete those and put them back. Is there anyway around
this? It is alot of work to delete the controls and put them back.
5. My project and dll are all in the same solution and
the buildorder is my dll first then my form. I have even tried
rebuilding thewhole solution.
Thanks.
Wayne
.