Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

TextBox additional property

$
0
0

I have a textbox control with an additional property, I also use a base form, in the processleave I set the background color to the default which works fine, I want to format the field as well - but I cannot seem to see the extra property.can anyone suggest how to to do this.

Thanks in advance - using vs2012 .net2

  protected virtual void ProcessLeave(object sender, System.EventArgs e)
        {
            try
            {

                switch (sender.GetType().ToString().ToUpper())
                {


                    case "BD.DEV.CONTROLS.TEXTBOX_F":

                        ((TextBox)sender).BackColor = Color.FromKnownColor(KnownColor.Window);//set the colour to the default


                        if (((TextBox)sender).SPECIALFIELD????.ToString () == "numeric")
                        {
                            ((TextBox)sender).Text = string.Format("{0:0}", decimal.Parse(((TextBox)sender).Text));
                        }
                        break;
                    case "SYSTEM.WINDOWS.FORMS.COMBOBOX":
                        ((ComboBox)sender).BackColor = Color.FromKnownColor(KnownColor.Window);
                        break;
                    case "SYSTEM.WINDOWS.FORMS.TEXTBOX":
                        ((TextBox)sender).BackColor = Color.FromKnownColor(KnownColor.Window);
                        break;
                    default:
                        break;

                }
            }
            catch { }

        }


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>