Subclassing DevEx.TextEdit


Author
Message
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I would like to subclass the Microfour.Strataframe.UI.Windows.Forms.DevEx.TextEdit so I don't have to set all the properties each time to get currency box behavior when I drop one on a form (this form will have > 30 ) I will be using this to bind to character fields as well.



I am still a little uncertain as to how masking works in .NET.



I am trying to add a new component, and set the inherits, then set the properties I want in the properties sheet. I get a warning that fProperties has a the exact property in the base class and should be marked Shadows but I'm out of my depth on exactly how to set this up.



I'd be open to any alternative suggestions as to how to create the textbox that will behave right to left, 2 decimals, show with normal backcolor when disabled or readonly etc. The DevEx.TextEdit ( part of the DevExpress freebie in the XtraEditors ) might be the easiest to adapt for my purposes but if anyone has built something else they'd like to share I'd certainly like to see it.



Assume others have been down this path before so I'll look forward to suggestions.



TIA
Replies
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I am trying to SubClass the DevEx TextEdit control and use the AutoAdjustMaxLength property thats in the SF TextBox.

If this is now included as standard, could someone point me in the right direction, if not , some pointers to where the code is in the SF Source Code, or if somebody has already done it in C#, that would be very useful 
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Gerard,

The code is in the TextBox.vb class in the MicroFour StrataFrame UI project's source code.  Take a look at the AutoAdjustMaxLength property and the UpdateMaxLength() method.  You can copy that to the TextEdit class in the SF DevExpress Wrapper source, then recompile and all should be good.

Edhy Rijo

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Iseem to have this fully working now..many thanks for all contributions.

I did run into one little issue. When I amneded the SF Source Code for the Inherited textEdit, I 'noticed'  that there was not a MaxLength property. So. ok I wrote the code to 'Create' a new Maxlength property in the subclassed TexEdit control. Of course this made no difference when Iran the code . I then went back and noticed that ther was a Maxlength property already there , but it was in a 'Property' property. Just for lurkers may save a bit of time !!
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Gerard,
Thanks for the clarification.  So the property name in DevExpress is Property.MaxLentgh then.

Edhy Rijo

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Edhy.

Yes. Most of properties are at the root (e.g. .Font  , .MaximumSize etc.)  but there are a good number then in a section called Properties , and one of these is MaxLength
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Charles R Hankey - 15 Years Ago
Trent L. Taylor - 15 Years Ago
Charles R Hankey - 15 Years Ago
Charles R Hankey - 15 Years Ago
Bill Cunnien - 15 Years Ago
Charles R Hankey - 15 Years Ago
Bill Cunnien - 15 Years Ago
Greg McGuffey - 15 Years Ago
Charles R Hankey - 15 Years Ago
Bill Cunnien - 15 Years Ago
Bill Cunnien - 15 Years Ago
Greg McGuffey - 15 Years Ago
Bill Cunnien - 15 Years Ago
Bill Cunnien - 15 Years Ago
                         Dude.

Just saw it.

AutoAdjustMaxLength property...
Bill Cunnien - 15 Years Ago
                             Nope...it is NOT on the TextEdit control. Alas!
The control was...
Bill Cunnien - 15 Years Ago
                                 There is no reason for us to do it when you guys are making the change...
Trent L. Taylor - 15 Years Ago
                                     Heh heh...you betcha! I am opening the source code, as we speak....
Bill Cunnien - 15 Years Ago
                                     I am trying to SubClass the DevEx TextEdit control anduse the...
Ger Cannoll - 14 Years Ago
                                         Hi Gerard, The code is in the TextBox.vb class in the MicroFour...
Edhy Rijo - 14 Years Ago
                                             Iseem to have this fully working now..many thanks for all...
Ger Cannoll - 14 Years Ago
                                                 Hi Gerard, Thanks for the clarification. So the property name in...
Edhy Rijo - 14 Years Ago
                                                     Hi Edhy. Yes. Most of properties are at the root (e.g. .Font ,...
Ger Cannoll - 14 Years Ago
Charles R Hankey - 15 Years Ago
Charles R Hankey - 15 Years Ago
Bill Cunnien - 15 Years Ago
Charles R Hankey - 15 Years Ago
Charles R Hankey - 15 Years Ago
Charles R Hankey - 15 Years Ago
Bill Cunnien - 15 Years Ago
Bill Cunnien - 15 Years Ago
Charles R Hankey - 15 Years Ago
Bill Cunnien - 15 Years Ago
Bill Cunnien - 15 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search