Click here to Skip to main content
15,920,005 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to Add Two Different Strings to same Index In a Combobox - .NET1.1 Pin
Tom Deketelaere10-Dec-08 2:25
professionalTom Deketelaere10-Dec-08 2:25 
GeneralRe: How to Add Two Different Strings to same Index In a Combobox - .NET1.1 Pin
Puneet Bhatnagar11-Dec-08 1:49
Puneet Bhatnagar11-Dec-08 1:49 
GeneralRe: How to Add Two Different Strings to same Index In a Combobox - .NET1.1 Pin
Tom Deketelaere11-Dec-08 2:08
professionalTom Deketelaere11-Dec-08 2:08 
GeneralError Message Pin
Puneet Bhatnagar11-Dec-08 16:17
Puneet Bhatnagar11-Dec-08 16:17 
AnswerRe: How to Add Two Different Strings to same Index In a Combobox - .NET1.1 Pin
riced9-Dec-08 3:15
riced9-Dec-08 3:15 
GeneralRe: How to Add Two Different Strings to same Index In a Combobox - .NET1.1 Pin
Jon_Boy11-Dec-08 4:27
Jon_Boy11-Dec-08 4:27 
GeneralFacing Problem while retrieving Pin
Puneet Bhatnagar11-Dec-08 17:53
Puneet Bhatnagar11-Dec-08 17:53 
GeneralRe: Facing Problem while retrieving Pin
riced12-Dec-08 5:21
riced12-Dec-08 5:21 
Not sure why that is happening.
I used the following to test it. The only difference is that I'm getting a new object each time.
You might also look at my versions of the other to subs - they don't need the index and I make an explicit cast to type TheData.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   Dim d As TheData = New TheData()
   Me.cboProject.BeginUpdate()
   d.firstString = "Duke"
   d.secondString = "USA"
   Me.cboProject.Items.Insert(0, d)  ' or me.cboProject.Items.Add(d)

   d = New TheData()
   d.firstString = "Alice"
   d.secondString = "England"
   Me.cboProject.Items.Insert(0, d)  ' or me.cboProject.Items.Add(d)

   d = New TheData()
   d.firstString = "Bob"
   d.secondString = "Australia"
   Me.cboProject.Items.Insert(0, d)  ' or me.cboProject.Items.Add(d)

   d = New TheData()
   d.firstString = "Duncan"
   d.secondString = "Scotland"
   Me.cboProject.Items.Insert(0, d)  ' or me.cboProject.Items.Add(d)

   d = New TheData()
   d.firstString = "Puneet"
   d.secondString = "India"
   Me.cboProject.Items.Insert(0, d)  ' or me.cboProject.Items.Add(d)

   Me.cboProject.EndUpdate()
End Sub

Private Sub CboProject_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboProject.SelectedIndexChanged
   GetProjectID()
End Sub

Public Sub GetProjectID()
   Dim d1 As TheData = New TheData()
   d1 = CType(Me.cboProject.SelectedItem, TheData)
   RichTextBox1.Text = d1.secondString
   RichTextBox1.Text = RichTextBox1.Text & "   " & d1.firstString
End Sub
Hope this helps.
GeneralRe: Facing Problem while retrieving Pin
riced16-Dec-08 0:05
riced16-Dec-08 0:05 
GeneralRe: How to Add Two Different Strings to same Index In a Combobox - .NET1.1 Pin
Luc Pattyn9-Dec-08 3:35
sitebuilderLuc Pattyn9-Dec-08 3:35 
Questionvisual basic Pin
jayachandra.c8-Dec-08 19:51
jayachandra.c8-Dec-08 19:51 
AnswerRe: visual basic Pin
Christian Graus8-Dec-08 21:11
protectorChristian Graus8-Dec-08 21:11 
AnswerRe: visual basic Pin
~Khatri Mitesh~9-Dec-08 0:37
~Khatri Mitesh~9-Dec-08 0:37 
AnswerRe: visual basic Pin
Jon_Boy9-Dec-08 3:32
Jon_Boy9-Dec-08 3:32 
Questioncode to save editable data from MSFlexgid to database in vb 6.0. [modified] Pin
sumit52838-Dec-08 19:45
sumit52838-Dec-08 19:45 
AnswerRe: code to save editable data from MSFlexgid to database. Pin
Christian Graus8-Dec-08 21:12
protectorChristian Graus8-Dec-08 21:12 
QuestionCommunication between computers... Pin
Subjugate8-Dec-08 19:00
Subjugate8-Dec-08 19:00 
AnswerRe: Communication between computers... Pin
Steven J Jowett9-Dec-08 0:11
Steven J Jowett9-Dec-08 0:11 
GeneralRe: Communication between computers... Pin
Subjugate9-Dec-08 16:14
Subjugate9-Dec-08 16:14 
GeneralRe: Communication between computers... Pin
Steven J Jowett10-Dec-08 1:33
Steven J Jowett10-Dec-08 1:33 
GeneralRe: Communication between computers... Pin
Subjugate10-Dec-08 14:14
Subjugate10-Dec-08 14:14 
QuestionVideo Implementation Pin
Johndas8-Dec-08 18:40
Johndas8-Dec-08 18:40 
AnswerRe: Video Implementation Pin
Christian Graus8-Dec-08 19:42
protectorChristian Graus8-Dec-08 19:42 
QuestionCreating a MS Access 2007 Database problem... Pin
VIP-CoMmAnDo8-Dec-08 11:31
VIP-CoMmAnDo8-Dec-08 11:31 
QuestionDrag And Drop Into A Datagrid Pin
Phantom7158-Dec-08 11:22
Phantom7158-Dec-08 11:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.