Converting Properties from VB to C#


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
I'd like to get the following code (from InheritedUI DevEx.TextEdit control) to work in C#:





.Private _ControlSourceUpdateMode As ControlUpdateMode = ControlUpdateMode.OnPropertyChanged

.Public Property ControlSourceUpdateMode() As System.Windows.Forms.ControlUpdateMode Implements IBusinessBindable.ControlSourceUpdateMode

. Get

. Return Me._ControlSourceUpdateMode

. End Get

. Set(ByVal value As System.Windows.Forms.ControlUpdateMode)

. Me._ControlSourceUpdateMode = value

. End Set

.End Property





Here is what I have, so far:





.private ControlUpdateMode _ControlSourceUpdateMode = ControlUpdateMode.OnPropertyChanged;

.public ControlUpdateMode IBusinessBindable.ControlSourceUpdateMode

.{

. get { return _ControlSourceUpdateMode; }

. set { _ControlSourceUpdateMode = value; }

.}





I think that Implements keyword in VB is throwing me off. Can anyone help me with this?



Thanks!!

Bill



P.S. How do I get the copied code to follow the proper indenting after I paste it? I know there must be some trick...I just cannot remember it.

Replies
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
The properties are accessible from code but not in the designer. What is the trick?
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Note sure. There usually isn't a trick. The designer will show all public properties of your class, unless you tell it not to. So, unless the base class is messing with things, you should be able to see the property in the designer. I usually have issues of it not showing what I want it to show (defaults not setup, editor not setup right, type converters messed up, etc.), but the property is usually there.



Just to check, you do mean that the properties are not accessible when you drop the control on a form right? Because, they won't be if you mean the designer of the control itself. Only the base class properties (and below) are available there.
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Interesting. I'll go back to my original plan. Thanks for your help!!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Bill Cunnien - 15 Years Ago
Bill Cunnien - 15 Years Ago
Bill Cunnien - 15 Years Ago
Greg McGuffey - 15 Years Ago
Bill Cunnien - 15 Years Ago
Greg McGuffey - 15 Years Ago
Bill Cunnien - 15 Years Ago
                         This is related to interface implementation. This property:
...
Greg McGuffey - 15 Years Ago
                             Ok. Makes sense. I think. Sort of. Kinda.

Here is my...
Bill Cunnien - 15 Years Ago
                                 The properties are accessible from code but not in the designer. What...
Bill Cunnien - 15 Years Ago
                                     Note sure. There usually isn't a trick. The designer will show all...
Greg McGuffey - 15 Years Ago
                                         Interesting. I'll go back to my original plan. Thanks for your...
Bill Cunnien - 15 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search