Can't set some properties in a user control |
Post Reply |
Author | |
RedFin
Groupie Joined: 26 March 2008 Location: Australia Status: Offline Points: 47 |
Post Options
Thanks(0)
Posted: 29 March 2008 at 11:33pm |
Hi,
I have created an ActiveX control for my application. This ActiveX control has a CodeJock ComboBox and FlatEdit control on it. I cannot change some of the properties of the ComboBox or FlatEdit controls. For example, my ActiveX control has the following property - Public Property Let ComboStyle(lComboStyle As ComboBoxStyle) mlComboStyle = lComboStyle Combo1.Style = mlComboStyle PropertyChanged "ComboStyle" End Property When I change the "ComboStyle" property in both design time or runtime, the ActiveX Control's property changes, but the Combo style does not. If I put a break point on the "PropertyChanged" line, and then inspect the values of "Combo1.Style" and "mlComboStyle" I see that "Combo1.Style" is fixed on 2 (the default) and mlComboStyle is 0 (what I am trying to change it to). I am having the same problem when changing the FlatEdit controls "MultiLine" property, using the same process. Does anyone have any ideas what I am doing wrong? Many thanks, Rohan |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
Maybe they are ReadOnly properties and you cannot assign a value to it during runtime. Maybe CJ controls don't raise an error if you try to do this. If you try this with a MS control you will get an error: "Can't assign to a readonly property".
This has nothing to do with, in your case, an activeX. Try to assign a value to the same property in a form and you will have the same problem. |
|
RedFin
Groupie Joined: 26 March 2008 Location: Australia Status: Offline Points: 47 |
Post Options
Thanks(0)
|
Hi Aaron,
Good call, you are exactly right. If I place a combo box on a form and try to change its style property during runtime, I can't. So, this must mean that even in the IDE (VB6 by the way) for my application, the ActiveX control itself is in runtime and therefore my code above doesn't work. Does anyone have any suggestions as to what I can do to get this to work? Thanks, Rohan |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Rohan,
I think it's not possible to do this. Maybe the API gods will have mercy with you ( I doubt that, I fell on my knees several times but no reponce on the other side)
But why do you want to change the style during runtime?
|
|
RedFin
Groupie Joined: 26 March 2008 Location: Australia Status: Offline Points: 47 |
Post Options
Thanks(0)
|
Thanks Aaron.
I don't want to change the style during the runtime of the app....what appears to be happening is that during design time of the application, the ActiveX component is actually in "runtime" and therefore, I can't change the style property that way - there are instances where I want the ActiveX control to display the constituent combo control using the different styles. Cheers |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |