|
-
Mar 20th, 2000, 12:55 PM
#1
Thread Starter
Lively Member
I'm trying to create user control based on the combo box control, because I'd like to include some properties that I can use throughout the application.
I have problem inheriting the Style property, as this property can only be set at design time. Any suggestions on how I can solve this problem?
Thanks.
-
Mar 20th, 2000, 06:53 PM
#2
Frenzied Member
You can put a validation routine in your property let to stop the user setting this propery at run time, something like
Code:
if not usercontrol.ambient.usermode then
cboChild.Style=NewStyle
End IF
usercontrol.ambient.usermode returns true at runtime and false at design time so the user will not be able to set the style at runtime.
If that's not good enough your going to have to create 3 combo boxes in your control and flip between them, or start from scratch.
Hope this helps
-
Mar 22nd, 2000, 06:03 PM
#3
Fanatic Member
You cannot change design only properties in a User Control.
You will have to include a new Combo Box in your Control for each style you want to use. In the code, make the appropriate Combo visible depending upon which Style you want.
-
Mar 22nd, 2000, 06:11 PM
#4
Hyperactive Member
Indeed, never forget that any control that you place on a usercontrol, is run-time for that control. So it is always impossible to set that kind of properties (at least not with plain VB code). Another example is the multiline property of a textbox that you use on a usercontrol; you can't set that 'cause it's runtime for the textbox, although for your control it's designtime.
-
Mar 22nd, 2000, 07:26 PM
#5
Frenzied Member
Yeah, I should have noticed that last one, If you're any good with the API it's probably worth starting from scratch, if you have 3 comboboxes then that will take up 4 times the memory of a single combo box, (once for each combo and once for the usreconrol itself.) Plus if you start from scratch you can make the combo box lok exagtly how you want it to. If that seems too much like hard work then dont bother.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|