Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi'

i want to create the get set property of controll so the item which i select reflet in text box if the are in differnt form..
Posted
Comments
Karthik_Mahalingam 4-Dec-13 1:52am    
Please add more info to your question..
Add some piece of code..
rahuls1 4-Dec-13 2:34am    
public ComboBox combox1
{
get
{
return combox1;
}
set
{
combox1.SelectedIndex = comboBox1.SelectedIndex;
}
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void textBox1_TextChanged(object sender, EventArgs e)
{
textBox1.Text = combox1.SelectedIndex.ToString();

}

}
rahuls1 4-Dec-13 2:34am    
i want to do in Form load event
Richard MacCutchan 4-Dec-13 4:59am    
The combobox will not have a selected item in the form load. Also, the get and set methods in your sample above do not do anything. It would be a better idea to use data binding between your combo and text boxes.
rahuls1 4-Dec-13 5:10am    
can u give idea how to use get/set property in this case..

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