|
Hi, I have just competed my BCA Degree, and i have intermediate hand in vb.net. I faced a problem while i was building an windows application for stock management and that was, i retrieve the data from database and inserted it into combo box. But now, I want that the combo box should be read only. The user could only select the available options from the combo box. I tried very much to do so, but i couldn't find this property at all. So, please help me, and write me how it could be possible? And i want to know one more thing that, how could we save any value in the windows registry and retrieve the saved value through windows application | | Bhuwan Chandra Arya Wednesday, August 12, 2009 11:08 AM | Ok, I have a solution if you just want the user to be able to use those values. before any action, you could put a checK:
if (comboBox1.Items.Contains(comboBox1.Text))
{
///the action to perform
}
else
{
MessageBox.Show("The specified value is not allowed.");
}
Regards,
Haris Umer
.::AlwayX A LearneR::. - Marked As Answer byBhuwan Chandra Arya Friday, August 14, 2009 5:33 AM
-
| | Haris Umer Wednesday, August 12, 2009 11:18 AM | Hi, For read only combobox set combobox properties dropdownstyle as DropDownList. for registry this link will may help you http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/4f4de17b-9b91-4610-9b64-121f224f3747/i hope it will help you
Best Regards, C.Gnanadurai ----------------------- Please mark the post as answer if it is helpfull to you - Marked As Answer byBhuwan Chandra Arya Friday, August 14, 2009 5:33 AM
-
| | Gnanadurai Wednesday, August 12, 2009 12:30 PM | In code you can do this:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
End Sub
Only performance counts! - Marked As Answer byBhuwan Chandra Arya Wednesday, August 19, 2009 1:24 PM
-
| | Sylva Thursday, August 13, 2009 7:09 PM | Ok, I have a solution if you just want the user to be able to use those values. before any action, you could put a checK:
if (comboBox1.Items.Contains(comboBox1.Text))
{
///the action to perform
}
else
{
MessageBox.Show("The specified value is not allowed.");
}
Regards,
Haris Umer
.::AlwayX A LearneR::. - Marked As Answer byBhuwan Chandra Arya Friday, August 14, 2009 5:33 AM
-
| | Haris Umer Wednesday, August 12, 2009 11:18 AM | Hi, For read only combobox set combobox properties dropdownstyle as DropDownList. for registry this link will may help you http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/4f4de17b-9b91-4610-9b64-121f224f3747/i hope it will help you
Best Regards, C.Gnanadurai ----------------------- Please mark the post as answer if it is helpfull to you - Marked As Answer byBhuwan Chandra Arya Friday, August 14, 2009 5:33 AM
-
| | Gnanadurai Wednesday, August 12, 2009 12:30 PM | In code you can do this:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
End Sub
Only performance counts! - Marked As Answer byBhuwan Chandra Arya Wednesday, August 19, 2009 1:24 PM
-
| | Sylva Thursday, August 13, 2009 7:09 PM |
|