Click here to Skip to main content
16,007,760 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

My Question is :

I am populating Data in a RichtextBox on selection of a particular record in the Combobox, the richtextbox will be editable but on its edit i want combobox to be disabled as in No one can select a different record from the combobox. Hope u got what is my query.
Posted
Comments
Sergey Alexandrovich Kryukov 7-Nov-11 1:28am    
1) Tag the UI library: WPF, Silverlight, Forms, what? 2) What is "on its edit"?
--SA

1 solution

Please see my comment. It's not good to answer for all variants. Always specify exact type. There is more than one type called RichTextBox. Always use a full name.

Also, "on its edit" might mean different things. It can be the event Focus or TextChanged. Think about which one you need to indicate "on its edit" and disable the ComboBox instance in its handler:

C#
myRichTextBox.TextChanged /* or .Focus */ += (sender, eventArgs) => {
    myComboBox.Enabled = false;
    //or
    //myComboBox.IsEnabled = false; //always specify UI library!
}


See:
http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.aspx[^].

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900