﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Subclassing DevEx.TextEdit</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 17 May 2026 21:58:17 GMT</lastBuildDate><ttl>20</ttl><item><title>Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25852.aspx</link><description>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 &gt; 30 )   I will be using this to bind to character fields as well.  &lt;br&gt;
&lt;br&gt;
I am still a little uncertain as to how masking works in .NET.&lt;br&gt;
&lt;br&gt;
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[b] fProperties[/b] has a the exact property in the base class and should be marked[b] Shadows[/b] but I'm out of my depth on exactly how to set this up.&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
Assume others have been down this path before so I'll look forward to suggestions.&lt;br&gt;
&lt;br&gt;
TIA</description><pubDate>Tue, 05 Apr 2011 11:06:50 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost29843.aspx</link><description>Hi Edhy.&lt;br/&gt;&lt;br/&gt;Yes. Most of properties are at the root (e.g. .Font&amp;nbsp; , .MaximumSize etc.) &amp;nbsp;but there are a good number then in a section called Properties , and one of these is MaxLength</description><pubDate>Tue, 05 Apr 2011 11:06:50 GMT</pubDate><dc:creator>Ger Cannoll</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost29838.aspx</link><description>Hi Gerard,&lt;br/&gt;Thanks for the clarification.&amp;nbsp; So the property name in DevExpress is &lt;span style="font-weight: bold;"&gt;Property.MaxLentgh&lt;/span&gt; then.</description><pubDate>Tue, 05 Apr 2011 08:21:11 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost29834.aspx</link><description>Iseem to have this fully working now..many thanks for all contributions.&lt;br/&gt;&lt;br/&gt;I did run into one little issue. When I amneded the SF Source Code for the Inherited textEdit, I &lt;font color=#ff0000&gt;'noticed'&lt;/font&gt; &amp;nbsp;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 !!</description><pubDate>Tue, 05 Apr 2011 05:09:40 GMT</pubDate><dc:creator>Ger Cannoll</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost29826.aspx</link><description>Hi Gerard,&lt;br/&gt;&lt;br/&gt;The code is in the TextBox.vb class in the MicroFour StrataFrame UI project's source code.&amp;nbsp; Take a look at the AutoAdjustMaxLength property and the UpdateMaxLength() method.&amp;nbsp; You can copy that to the TextEdit class in the SF DevExpress Wrapper source, then recompile and all should be good.</description><pubDate>Fri, 01 Apr 2011 12:51:29 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost29825.aspx</link><description>I am trying to SubClass the DevEx TextEdit control and&amp;nbsp;use the AutoAdjustMaxLength property thats in the SF TextBox.&lt;br/&gt;&lt;br/&gt;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&amp;nbsp;</description><pubDate>Fri, 01 Apr 2011 10:53:53 GMT</pubDate><dc:creator>Ger Cannoll</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25991.aspx</link><description>After all of the fun, I have the following functioning code.  It is not much different than where I started before attempting to recreate the SF code.&lt;br&gt;
&lt;br&gt;
[codesnippet]using MicroFour.StrataFrame.Business;&lt;br&gt;
using System;&lt;br&gt;
using System.Data;&lt;br&gt;
using System.Drawing;&lt;br&gt;
&lt;br&gt;
namespace Aspire.SubclassedControls.DevEx&lt;br&gt;
{&lt;br&gt;
    public class TextEdit : MicroFour.StrataFrame.UI.Windows.Forms.DevEx.TextEdit&lt;br&gt;
    {&lt;br&gt;
        public TextEdit()&lt;br&gt;
        {&lt;br&gt;
            InitializeControl();&lt;br&gt;
        }&lt;br&gt;
&lt;br&gt;
        private void InitializeControl()&lt;br&gt;
        {&lt;br&gt;
            Properties.AppearanceDisabled.BackColor = Color.FromName("Info");&lt;br&gt;
            Properties.AppearanceDisabled.ForeColor = Color.FromName("InfoText");&lt;br&gt;
            Properties.AppearanceReadOnly.BackColor = Color.FromName("Info");&lt;br&gt;
            Properties.AppearanceReadOnly.ForeColor = Color.FromName("InfoText");&lt;br&gt;
        }&lt;br&gt;
&lt;br&gt;
        protected override void OnBindingContextChanged(EventArgs e)&lt;br&gt;
        {&lt;br&gt;
            base.OnBindingContextChanged(e);&lt;br&gt;
            if ((BusinessObject != null) &amp;&amp; (BindingField != String.Empty))&lt;br&gt;
            {&lt;br&gt;
                if (((BusinessLayer)BusinessObject).FieldDbTypes[BindingField] == DbType.AnsiString)&lt;br&gt;
                    Properties.MaxLength = ((BusinessLayer)BusinessObject).FieldLengths[BindingField];&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
}[/codesnippet]&lt;br&gt;</description><pubDate>Fri, 12 Feb 2010 12:36:50 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25988.aspx</link><description>I pulled the appearance properties out of the if-statement.  That should take care of that piece of the puzzle.  Silly me.&lt;br&gt;
&lt;br&gt;
As far as the copy/paste routine....yup, that is what I do.  I lose all of the indentation, though.&lt;br&gt;
&lt;br&gt;
Perhaps, it a Google Chrome thing.</description><pubDate>Fri, 12 Feb 2010 12:23:40 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25987.aspx</link><description>I'm calling initializecomponent and you're calling initializecontrol ?&lt;br&gt;
&lt;br&gt;
I just copied the code from my class in vs and pasted between the codesnippet ifcodes.   Get it indented in VS is an IDE options thing.&lt;br&gt;</description><pubDate>Fri, 12 Feb 2010 12:21:14 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25984.aspx</link><description>btw, how do you get your posted code to have the indentation...I knew once how to do it.  I've forgotten.</description><pubDate>Fri, 12 Feb 2010 11:42:58 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25983.aspx</link><description>Thanks for working this out with me.  Here is the code that I am using:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
using MicroFour.StrataFrame.Business;&lt;br&gt;
using System;&lt;br&gt;
using System.Data;&lt;br&gt;
using System.Drawing;&lt;br&gt;
&lt;br&gt;
namespace Aspire.SubclassedControls.DevEx&lt;br&gt;
{&lt;br&gt;
    public class TextEdit : MicroFour.StrataFrame.UI.Windows.Forms.DevEx.TextEdit&lt;br&gt;
    {&lt;br&gt;
        public TextEdit()&lt;br&gt;
        {&lt;br&gt;
            InitializeControl();&lt;br&gt;
        }&lt;br&gt;
&lt;br&gt;
        private void InitializeControl()&lt;br&gt;
        {&lt;br&gt;
            if ((BusinessObject != null) &amp;&amp; (BindingField != String.Empty))&lt;br&gt;
            {&lt;br&gt;
                Properties.AppearanceDisabled.BackColor = Color.FromName("Info");&lt;br&gt;
                Properties.AppearanceDisabled.ForeColor = Color.FromName("InfoText");&lt;br&gt;
                Properties.AppearanceReadOnly.BackColor = Color.FromName("Info");&lt;br&gt;
                Properties.AppearanceReadOnly.ForeColor = Color.FromName("InfoText");&lt;br&gt;
                if (((BusinessLayer)BusinessObject).FieldDbTypes[BindingField] == DbType.AnsiString)&lt;br&gt;
                    Properties.MaxLength = ((BusinessLayer)BusinessObject).FieldLengths[BindingField];&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
Looks quite similar to your's, eh?&lt;br&gt;</description><pubDate>Fri, 12 Feb 2010 11:41:59 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25980.aspx</link><description>Okay, I tested this and it works :&lt;P&gt;[codesnippet]using System;&lt;BR&gt;using System.Collections.Generic;&lt;BR&gt;using System.Text;&lt;BR&gt;using System.Data;&lt;BR&gt;using System.Drawing;&lt;BR&gt;using System.Windows.Forms;&lt;/P&gt;&lt;P&gt;&lt;BR&gt;namespace SFCsharpTest&lt;BR&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class dxTextEditC : MicroFour.StrataFrame.UI.Windows.Forms.DevEx.TextEdit&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public dxTextEditC()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.initializecomponent();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void initializecomponent()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.BindingFormat = "c";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Properties.Appearance.Options.UseTextOptions = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Properties.AppearanceDisabled.BackColor = System.Drawing.Color.White;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Properties.AppearanceDisabled.ForeColor = System.Drawing.Color.Black;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Properties.AppearanceDisabled.Options.UseBackColor = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Properties.AppearanceDisabled.Options.UseForeColor = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Properties.AppearanceDisabled.Options.UseTextOptions = true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Properties.AppearanceDisabled.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;I'm attaching a C# project that demonstrates it.&amp;nbsp; &lt;BR&gt;</description><pubDate>Fri, 12 Feb 2010 11:25:29 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25975.aspx</link><description>I noticed your class is defined as partial.   Is there some other part to it?  What happens if you just translate my code into C# and paste directly into a class.cs ?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;</description><pubDate>Fri, 12 Feb 2010 11:10:28 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25974.aspx</link><description>I'm going to let Greg or Trent step in on this one.  Not sure if this works differently in C#.  &lt;br&gt;
&lt;br&gt;
Looks pretty solid in VB.  The code I posted is the entirety of the code in my dxTextEditC.vb class.  &lt;br&gt;
&lt;br&gt;
When dropped on a form from the toolbox I see all the properties set by default ( including being bolded ) as if I had manually set them as dropping the SF control on. &lt;br&gt;
&lt;br&gt;
Are you subclassing the SF wrapper or the Dx control directly?&lt;br&gt;</description><pubDate>Fri, 12 Feb 2010 11:08:29 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25971.aspx</link><description>I just tried this approach (add a constructor with an initialization method) and the control at design-time does not set the properties according to the specifications within the init method.  How are you getting this thing to work?  I went back to the drawing board on my control (mostly to try out some new ideas), but have gotten back to the same place that I was earlier in the week...setting these properties in a layout method or attaching them to an event (e.g. OnBindingContextChanged).</description><pubDate>Fri, 12 Feb 2010 10:58:29 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25963.aspx</link><description>(addendum )&lt;br&gt;
&lt;br&gt;
Here's the properties I added to get the TextEdit control working just the way I want it for 2 decimal numbers :&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
        Me.Properties.EditFormat.FormatString = "000,000,000.00"&lt;br&gt;
        Me.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric&lt;br&gt;
        Me.Properties.Mask.ShowPlaceHolders = False&lt;br&gt;
        Me.Properties.Mask.UseMaskAsDisplayFormat = True&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
BTW - the subclassed control is created from a humble Class, not a component or user control or DevExControl or whatever else might look tempting in the templates :)&lt;br&gt;
&lt;br&gt;
You will probalby need to close all forms you may have open and rebuild both the UI Class library and the project using the control in order to see what you need in the toolbox.  &lt;br&gt;
&lt;br&gt;
&lt;br&gt;</description><pubDate>Fri, 12 Feb 2010 10:18:05 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25960.aspx</link><description>Thanks to Bill and Greg, here's the finished dxTextEdit.vb I was trying to get.&lt;br&gt;
&lt;br&gt;
This subclasses the Strataframe DevEx wrapper for the DevExpress TextEdit control which is in the XtraEditors 9.3 now available free from DevExpress.  In this case I have set default properties to show the textbox normally when disabled, to treat its display and editing as numeric ( though in my usage I am binding to a character field ) and to right align the numbers, both for display and editing.  I will probably further refine this as I learn more about how I want to mask it, but this will demonstrate how to simply take advantage of these controls and subclass variations to save some time setting a lot of properties ( this control is being used 50+ times on a form ) &lt;br&gt;
&lt;br&gt;
From what Greg said the C# implementation may be different and I will leave that to those better qualified.&lt;br&gt;
&lt;br&gt;
Note:  I have this control in a UI project of my own subclasses of controls.  You need to reference &lt;br&gt;
&lt;br&gt;
DevExpress.Data.v9.3&lt;br&gt;
DevExpress.Utils.v9.3&lt;br&gt;
DevExpress.Xtra.Editors.v9.3&lt;br&gt;
&lt;br&gt;
in your project.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
[codesnippet]Imports System&lt;br&gt;
Imports System.Data&lt;br&gt;
Imports System.Drawing&lt;br&gt;
Imports System.Windows.Forms&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Public Class dxTextEditC&lt;br&gt;
    Inherits MicroFour.StrataFrame.UI.Windows.Forms.DevEx.TextEdit&lt;br&gt;
&lt;br&gt;
    Public Sub New()&lt;br&gt;
&lt;br&gt;
        Me.initializecomponent()&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
    Private Sub initializecomponent()&lt;br&gt;
&lt;br&gt;
        Me.BindingFormat = "c"&lt;br&gt;
        Me.Properties.Appearance.Options.UseTextOptions = True&lt;br&gt;
        Me.Properties.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far&lt;br&gt;
        Me.Properties.AppearanceDisabled.BackColor = System.Drawing.Color.White&lt;br&gt;
        Me.Properties.AppearanceDisabled.ForeColor = System.Drawing.Color.Black&lt;br&gt;
        Me.Properties.AppearanceDisabled.Options.UseBackColor = True&lt;br&gt;
        Me.Properties.AppearanceDisabled.Options.UseForeColor = True&lt;br&gt;
        Me.Properties.AppearanceDisabled.Options.UseTextOptions = True&lt;br&gt;
        Me.Properties.AppearanceDisabled.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far&lt;br&gt;
        Me.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric&lt;br&gt;
        Me.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
End Class[/codesnippet]</description><pubDate>Fri, 12 Feb 2010 09:50:05 GMT</pubDate><dc:creator>Charles R Hankey</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25932.aspx</link><description>Heh heh...you betcha!  I am opening the source code, as we speak.  I'll be making the change for my own extended control.  Easy-peasy.  Just thinking about that future developer... :cool:</description><pubDate>Wed, 10 Feb 2010 16:42:07 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25931.aspx</link><description>There is no reason for us to do it when you guys are making the change right now your self.  I really don't mind adding it, but no reason to wait on us.  Just open the SF source code to see our logic there and then transpose that over to TextEdit control. :)</description><pubDate>Wed, 10 Feb 2010 16:39:02 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25930.aspx</link><description>Nope...it is NOT on the TextEdit control.  Alas!&lt;br&gt;
The control was the MicroFour.StrataFrame.UI.Windows.Forms.Textbox.&lt;br&gt;
&lt;br&gt;
Got myself all worked up for nothing.  &lt;br&gt;
&lt;br&gt;
SF, do you think you could add that little nugget into the extended TextEdit control?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Bill</description><pubDate>Wed, 10 Feb 2010 16:33:03 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25929.aspx</link><description>Dude.&lt;br&gt;
&lt;br&gt;
Just saw it.&lt;br&gt;
&lt;br&gt;
AutoAdjustMaxLength property on the SF-extended DevEx TextEdit control.  &lt;br&gt;
&lt;br&gt;
Testing now.&lt;br&gt;
&lt;br&gt;</description><pubDate>Wed, 10 Feb 2010 16:27:27 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25928.aspx</link><description>I played around with my code a little more.  I could not get the properties to behave in the constructor.  The BusinessObject is always null at that point.  So, I tweaked things and found a better method to perform the rituals.  Here is the refined code:&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
using System;&lt;br&gt;
using System.Data;&lt;br&gt;
using System.Drawing;&lt;br&gt;
using System.Windows.Forms;&lt;br&gt;
&lt;br&gt;
namespace Aspire.SubclassedControls.DevEx&lt;br&gt;
{&lt;br&gt;
    public partial class TextEdit : MicroFour.StrataFrame.UI.Windows.Forms.DevEx.TextEdit&lt;br&gt;
    {&lt;br&gt;
        public TextEdit()&lt;br&gt;
        {&lt;br&gt;
            InitializeComponent();&lt;br&gt;
        }&lt;br&gt;
&lt;br&gt;
        private void TextEdit_BindingContextChanged(object sender, EventArgs e)&lt;br&gt;
        {&lt;br&gt;
            if ((BusinessObject != null) &amp;&amp; (BindingField != String.Empty))&lt;br&gt;
            {&lt;br&gt;
                Properties.AppearanceDisabled.BackColor = Color.FromName("Info");&lt;br&gt;
                Properties.AppearanceDisabled.ForeColor = Color.FromName("InfoText");&lt;br&gt;
                Properties.AppearanceReadOnly.BackColor = Color.FromName("Info");&lt;br&gt;
                Properties.AppearanceReadOnly.ForeColor = Color.FromName("InfoText");&lt;br&gt;
                if (((MicroFour.StrataFrame.Business.BusinessLayer)BusinessObject).FieldDbTypes[BindingField] == DbType.AnsiString)&lt;br&gt;
                    Properties.MaxLength = ((MicroFour.StrataFrame.Business.BusinessLayer)BusinessObject).FieldLengths[BindingField];&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
It is just a tad cleaner and places the changes at a point where it is better handled...someday my code may be changing the binding (doubt it, but one never knows).  Doing it this way I won't have to think about the sub-classed TextEdit control.</description><pubDate>Wed, 10 Feb 2010 16:23:11 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25924.aspx</link><description>[quote]...the DevX control is messing with stuff after the control is constructed...[/quote]&lt;br&gt;
&lt;br&gt;
Yup...I think it has to do with the support for application themes.</description><pubDate>Wed, 10 Feb 2010 15:19:29 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25923.aspx</link><description>I just made a minor change to the class...the properties for the back and fore colors were not showing up in the designer, so I did replaced the TextEdit_Layout method with this:&lt;br&gt;
&lt;br&gt;
[codesnippet]protected override void OnLayout(LayoutEventArgs levent)&lt;br&gt;
        {&lt;br&gt;
            base.OnLayout(levent);&lt;br&gt;
            if ((BusinessObject != null) &amp;&amp; (BindingField != String.Empty))&lt;br&gt;
            {&lt;br&gt;
                Properties.AppearanceDisabled.BackColor = Color.FromName("Info");&lt;br&gt;
                Properties.AppearanceDisabled.ForeColor = Color.FromName("InfoText");&lt;br&gt;
                Properties.AppearanceReadOnly.BackColor = Color.FromName("Info");&lt;br&gt;
                Properties.AppearanceReadOnly.ForeColor = Color.FromName("InfoText");&lt;br&gt;
            }&lt;br&gt;
        }[/codesnippet]&lt;br&gt;
&lt;br&gt;
That works nicely.&lt;br&gt;</description><pubDate>Wed, 10 Feb 2010 15:15:08 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Subclassing DevEx.TextEdit</title><link>http://forum.strataframe.net/FindPost25922.aspx</link><description>Yeah, I'd call the base class constructor in most cases.&lt;br&gt;
&lt;br&gt;
BTW, this does work when I try it with a SF textbox (I set backcolor, Text and IgnoreManageReadonlyState). There was some issues with some properties not immediately showing up, but they were there. Now, where this could get exiting is if the DevX control is messing with stuff after the control is constructed, which it sounds like it is, hence the need to figure out where you can finally manipulate properties without DevX stomping on those changes.&lt;br&gt;
&lt;br&gt;
Anyway, it sounds like in this case, you have to use the layout event.  :ermm:</description><pubDate>Wed, 10 Feb 2010 15:08:11 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>