D
Demonicpagan
I have this form where I am trying to place items from checked boxes
into a text box. An image of what this form looks like is at
http://www.stelth2000inc.com/images/screen.png
Here is some code I have done for the first 2 check boxes, name and
world, they do what I want them to do, but for the rest of the check
boxes, the codes would be a bit minotonous. Is there a better way of
doing this, maybe checkedboxlist?
Private Sub sigBtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles sigBtn.Click
Dim bbname As String = "
Dim bbworld As String = "
' Name check box checked
If chNameChk.Checked = True Then
signatureTxt.Text = ""
signatureTxt.Text = signatureTxt.Text & bbname
End If
' World check box checked
If worldChk.Checked = True Then
signatureTxt.Text = ""
signatureTxt.Text = signatureTxt.Text & bbworld
End If
' Name & world check boxes checked
If chNameChk.Checked = True And worldChk.Checked = True Then
signatureTxt.Text = ""
signatureTxt.Text = signatureTxt.Text & bbname & bbworld
End If
End Sub
The way that i am wanting this to work is the user selects items that
they would want in a forum signature. Each check box is representative
of items in other tabs in this program (i.e. Name is the Character name
which is a text box in the General Tab, World is a combo box in that
same tab). The user can select as many as all the check boxes or as
little as one check box. I was clearing the box and appending text to
the box in case user makes selections, clicks create signature, changes
their mind and selects other items, and clicks create signature again.
I didn't want the new selections following the old selections, but
rather overwrite what was previously there.
Ultimately output would look something like this if user was to select
the Character Name & World check boxes:
color=blue]Name: character name[/QUOTE]
Just Name:
Just World:
World & Linkshell:
so on and so forth
The checkbox I have as Sex will be outputting either
based on what radio button was selected in the General Tab. How will I
need to go about handling this with the rest of what I'm trying to do?
Just for knowledge purposes, I am using Visual Basic 2005 Express
Edition to code this
into a text box. An image of what this form looks like is at
http://www.stelth2000inc.com/images/screen.png
Here is some code I have done for the first 2 check boxes, name and
world, they do what I want them to do, but for the rest of the check
boxes, the codes would be a bit minotonous. Is there a better way of
doing this, maybe checkedboxlist?
Private Sub sigBtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles sigBtn.Click
Dim bbname As String = "
" & vbCrLfName: " &
charNameTxt.Text & "
Dim bbworld As String = "
" & vbCrLfWorld: " &
worldCombo.SelectedItem & "
' Name check box checked
If chNameChk.Checked = True Then
signatureTxt.Text = ""
signatureTxt.Text = signatureTxt.Text & bbname
End If
' World check box checked
If worldChk.Checked = True Then
signatureTxt.Text = ""
signatureTxt.Text = signatureTxt.Text & bbworld
End If
' Name & world check boxes checked
If chNameChk.Checked = True And worldChk.Checked = True Then
signatureTxt.Text = ""
signatureTxt.Text = signatureTxt.Text & bbname & bbworld
End If
End Sub
The way that i am wanting this to work is the user selects items that
they would want in a forum signature. Each check box is representative
of items in other tabs in this program (i.e. Name is the Character name
which is a text box in the General Tab, World is a combo box in that
same tab). The user can select as many as all the check boxes or as
little as one check box. I was clearing the box and appending text to
the box in case user makes selections, clicks create signature, changes
their mind and selects other items, and clicks create signature again.
I didn't want the new selections following the old selections, but
rather overwrite what was previously there.
Ultimately output would look something like this if user was to select
the Character Name & World check boxes:
color=blue]Name: character name[/QUOTE]
World: character world
Just Name:
Name: character name
Just World:
Name: character name
World & Linkshell:
World: character world
Linkshell: linkshell
so on and so forth
The checkbox I have as Sex will be outputting either
Sex: Male
or
Sex: Female
based on what radio button was selected in the General Tab. How will I
need to go about handling this with the rest of what I'm trying to do?
Just for knowledge purposes, I am using Visual Basic 2005 Express
Edition to code this