Discussion:
User Control(s) multiple instances
(too old to reply)
sid
2006-12-01 16:31:40 UTC
Permalink
I have created a user-control that uses a text box and a UpDown
control. The control works correctly, but the updown control on the
user-control only works in the
first instance of the user control, each additional instance has the
updown control grayed out like has been disabled or did not load
correctly.

Have you seen anything like this ?

Thanks
Sid.
Karl E. Peterson
2006-12-01 17:39:32 UTC
Permalink
Post by sid
I have created a user-control that uses a text box and a UpDown
control. The control works correctly, but the updown control on the
user-control only works in the
first instance of the user control, each additional instance has the
updown control grayed out like has been disabled or did not load
correctly.
Have you seen anything like this ?
Never seen that, nope. But I've also never incorporated a standalone OCX
within a UC. Sounded way too messy. You might find this class-based
replacement for the UpDown control works better in your situation...

http://vb.mvps.org/samples/UpDown
--
Working without a .NET?
http://classicvb.org/
sid
2006-12-01 23:48:15 UTC
Permalink
I looked at your example, looks a lot like what I created. (probably
for the same reasons)

"Stand alone OCX", I just created a user-control and added an UpDown
and a textbox with a couple of features that I needed.

I found a work around to my problem: I add an instance of my control
to a form and then copy that control and paste to create an array.
Both instances work correctly, then past 3 more time to create 5
controls in the array. Then one by one change the name of each control
and clear the index value (removing it from the array). Test, all work
and behave correctly.

Get this: Go to another form and paste a new instance of the control,
doesn't work. Go back to the old form and copy the original 1st
instance of the control, go back to the new form and paste, change name
and clear index, works correctly ! I thought the problem was localized
to just that form, but it seems to follow it throughout the project.

It acts like a problem with the way new controls are created from the
toolbox ?

Sid.
Post by Karl E. Peterson
Post by sid
I have created a user-control that uses a text box and a UpDown
control. The control works correctly, but the updown control on the
user-control only works in the
first instance of the user control, each additional instance has the
updown control grayed out like has been disabled or did not load
correctly.
Have you seen anything like this ?
Never seen that, nope. But I've also never incorporated a standalone OCX
within a UC. Sounded way too messy. You might find this class-based
replacement for the UpDown control works better in your situation...
http://vb.mvps.org/samples/UpDown
--
Working without a .NET?
http://classicvb.org/
Michael C
2006-12-04 03:31:05 UTC
Permalink
Post by Karl E. Peterson
Never seen that, nope. But I've also never incorporated a standalone OCX
within a UC. Sounded way too messy.
It's not really that uncommon or messy.

Michael

Loading...