Print Page | Close Window

Can't set some properties in a user control

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=10002
Printed Date: 16 September 2024 at 3:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Can't set some properties in a user control
Posted By: RedFin
Subject: Can't set some properties in a user control
Date 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



Replies:
Posted By: Aaron
Date Posted: 30 March 2008 at 4:19am
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.


Posted By: RedFin
Date Posted: 30 March 2008 at 5:00am
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


Posted By: Aaron
Date Posted: 31 March 2008 at 12:40am
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?


Posted By: RedFin
Date Posted: 31 March 2008 at 1:54am
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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net