Subclassing a SF ComboBox


Author
Message
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 have subclassed a SF combo box as:

public class ComboBox : MicroFour.StrataFrame.UI.Windows.Forms.ComboBox
{
}

However, when I use this, I get an error. Do I need to run the base code for ListPopulatingEvent (as I use this) or any other code in my subclassed control ?


Reply
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
Here is the code for my TextEdit control that I extended:





using System;

using System.Data;

using System.Drawing;

using System.Windows.Forms;



namespace Aspire.SubclassedControls.DevEx

{

    public partial class TextEdit : MicroFour.StrataFrame.UI.Windows.Forms.DevEx.TextEdit

    {

        public TextEdit()

        {

            InitializeComponent();

        }



        private void TextEdit_Layout(object sender, LayoutEventArgs e)

        {

            if ((BusinessObject != null) && (BindingField!=String.Empty))

            {

                Properties.AppearanceDisabled.BackColor = Color.FromName("Info");

                Properties.AppearanceDisabled.ForeColor = Color.FromName("InfoText");

                Properties.AppearanceReadOnly.BackColor = Color.FromName("Info");

                Properties.AppearanceReadOnly.ForeColor = Color.FromName("InfoText");

            }

        }



        private void TextEdit_Enter(object sender, EventArgs e)

        {

            if (((MicroFour.StrataFrame.Business.BusinessLayer)BusinessObject).FieldDbTypes[BindingField] == DbType.String)

            {

                Properties.MaxLength = ((MicroFour.StrataFrame.Business.BusinessLayer)BusinessObject).FieldLengths[BindingField];

            }

        }

    }

}




Maybe this example will help.



Have a great day!

Bill

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ger Cannoll - 16 Years Ago
Bill Cunnien - 16 Years Ago
Greg McGuffey - 16 Years Ago
Les Pinter - 16 Years Ago
Ger Cannoll - 16 Years Ago
                 What is the error?
Trent L. Taylor - 16 Years Ago
Ger Cannoll - 16 Years Ago
                         Hi Gerard, A guy's walking down the street and sees a drunk down on...
Les Pinter - 16 Years Ago
                             Hi Les,

Very funny! at least after the 2 hours has passed...
Edhy Rijo - 16 Years Ago
                             Hi Les. Many thanks for spending the time on this. I was having a...
Ger Cannoll - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search