PDA

View Full Version : Help With Visual Basic Coding Issue



StevenVB
09-13-2011, 11:57 PM
Hi Basicly i have A Few Comboboxs that When i Click a button the selected item in each of the combo boxes will will appear as text in a textbox like this:

(.....[combobox1.selecteditem] [space] [combobox2.selecteditem] [space] [combobox3.selecteditem]....)

I have made attempts as i am new to programming i could not seem to figure this out if anyone understands what im talking about please feel free to provide some guidance:

My attempt please tell me where im going wrong or what i need to add thanks



If Timer1.Interval = 100 Then
txtDrop.Text = cmbMonster.SelectedItem
SendKeys.Send("{tab}")
SendKeys.Send(cmbCharms.SelectedItem.ToString(txtDrop.Text))
End If

tladyman
09-14-2011, 04:47 PM
vbtab is the tab character:

If Timer1.Interval = 100 Then
txtDrop.Text = cmbMonster.SelectedItem & vbtab
End If

Just use the & character to build the txtDrop.Text value.

There are other vb characters, like vbcrlf (carriage return linefeed, for next line) so you don't have to emulate keypresses.