|
-
Aug 4th, 2004, 12:09 AM
#1
Thread Starter
Addicted Member
Display textbox using combobox
Hi
how to select the required items in multiple comboboxes to
display individually into multiple textboxes / Label......
Example: Combo item 1 from combobox to display into textbox1
Combo item 2 from combobox2 to display into textbox2
Multiple tasks..
Thanks
-
Aug 4th, 2004, 12:22 AM
#2
TextBox1.Text = ComboBox1.SelectedItem.ToString
Is that what you mean? Not quite clear, though.
-
Aug 4th, 2004, 03:19 AM
#3
Thread Starter
Addicted Member
Hi
Still cannot...
I want to select the combo items and display into another form
I may select more than one combo boxes...
This is the error:
An unhandled exception of type 'System.NullReferenceException' occurred
Thanks
-
Aug 4th, 2004, 03:29 AM
#4
Thread Starter
Addicted Member
This is part of my code:
Code:
Private Sub btnAddAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddAdd.Click
Dim lblSubCategory, lblRepeat
Dim confirm As New Confirm
If cboSubCategory.Text <> "" And cboRepeat.Text <> "" Then
lblSubCategory.text = cboSubCategory.SelectedItem.ToString
lblRepeat.Text = cboRepeat.SelectedItem.ToString
confirm.Show()
Me.Hide()
Else
MessageBox.Show("Please fill the area", "Missing data", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
Last edited by toytoy; Dec 3rd, 2004 at 08:23 AM.
-
Aug 4th, 2004, 03:42 AM
#5
Thread Starter
Addicted Member
I solve it just because i forgot to put a dot in front the lblSubCategory and lblRepeat....
-
Aug 4th, 2004, 03:46 AM
#6
You may pound your head against a brick wall now.
-
Aug 4th, 2004, 08:17 PM
#7
Thread Starter
Addicted Member
Hi
Is there a way to make sure that some combo box is a required field to key in and some not....
At the same time, it can be send to display into the textbox..
Thanks
-
Aug 5th, 2004, 12:27 AM
#8
Originally posted by toytoy
Hi
Is there a way to make sure that some combo box is a required field to key in and some not....
THe combobox has a Tag property, you can store information about the combobox in there, and check it during your validation procedure.
-
Aug 5th, 2004, 01:15 AM
#9
Thread Starter
Addicted Member
Hi
What you mean by store information...
information is already inside the collection property....
or you means put the combo box name inside the tag...
actually how is this tag really work... i really blur..
Thanks
-
Aug 5th, 2004, 01:18 AM
#10
You said that you want to know whether the ComboBox is a required field or not. What you could do is set it's .Tag() property to "Required".
The Tag property can hold any object, I'd generally use it to hold a string with info about that particular field.
Later, when you are validating the inputs in the form, you can run through and check it's Tag() property to see if it's "Required" and then work accordingly.
I'm only giving you a rough idea, because you have a rough question, but it should do well enough.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|