Try this and see if your bug replicates
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Debug.WriteLine(Me.ComboBox1.Text & " " & Me.ComboBox1.SelectedValue)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim arrPerson As New ArrayList()
arrPerson.Add(New Person("1", "11"))
arrPerson.Add(New Person("2", "22"))
arrPerson.Add(New Person("3", "33"))
arrPerson.Add(New Person("4", "44"))
Me.ComboBox1.DataSource = arrPerson
Me.ComboBox1.DisplayMember = "Name"
Me.ComboBox1.ValueMember = "ID"
Me.DataGrid1.DataSource = arrPerson
End Sub
Public Class Person
Private _Name As String
Private _ID As String
Public Sub New(ByVal strName As String, ByVal strID As String)
MyBase.New()
Me._Name = strName
Me._ID = strID
End Sub
Public ReadOnly Property Name() As String
Get
Return _Name
End Get
End Property
Public ReadOnly Property ID() As String
Get
Return _ID
End Get
End Property
End Class
"guy" <gu*@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com:
using VS 2003
create a winforms app
add a datagrid to the form
and bind it to a an arraylist or similar
in the click event of the datagrid pop up a message box
run the app
click on the separator between rows (when you have the double headed
vertical arrow cursor)
the message box pops up but the mouse is trapped within the grid
borders!
code below:-
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim a As New ArrayList
a.Add(1)
a.Add(2)
a.Add(3)
Me.DataGrid1.DataSource = a
End Sub
Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGrid1.Click
MsgBox("oops", MsgBoxStyle.OKOnly)
End Sub