I have 2 classes one main class called Mygrid and another class inside it called TLBoxEditingControl which inherits a textbox into grid cell.
Also I have added one Listbox called LstBox to the usercontrol MyGrid.
1) Initially its visible is false. How can i make visible true in TLBoxEditingControl class.
2) I have an Event called MyList() in Main Class, how can I raise this event in TLBoxEditingControl class.
Here is the code i use, This is not working please expalin
Public Class MyGrid
Inherits DataGridView
Public Event MyList()
Public Sub New()
InitializeComponent()
Me.LstBox = New System.Windows.Forms.ListBox
Me.Controls.Add(Me.LstBox)
LstBox.Top = 20
LstBox.Left = 20
LstBox.Visible = False
End Sub
Private Sub LstList()
RaiseEvent MyList()
End Sub
End Class
Private Class TLBoxEditingControl
Inherits TextBox
Implements IDataGridViewEditingControl
Private DataGridViewControl As DataGridView
Private ValueIsChanged As Boolean = False
Private RowIndexNum As Integer
Dim Myg As New MyGrid()
Private Sub TlBoxEditingControl_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.TextChanged
Call Myg.LstList() ' Here I want to raise Mylist Event
Myg.LstBox.Visible = True ' Here i want to make LstBox visible
End Sub
End Class
I have added this control to a form and added this code
Private Sub MyGrid1_MyList() Handles MyGrid1.MyList
MsgBox("ggg")
End Sub
Here the event is not raising.
Thanks.
Also I have added one Listbox called LstBox to the usercontrol MyGrid.
1) Initially its visible is false. How can i make visible true in TLBoxEditingControl class.
2) I have an Event called MyList() in Main Class, how can I raise this event in TLBoxEditingControl class.
Here is the code i use, This is not working please expalin
Public Class MyGrid
Inherits DataGridView
Public Event MyList()
Public Sub New()
InitializeComponent()
Me.LstBox = New System.Windows.Forms.ListBox
Me.Controls.Add(Me.LstBox)
LstBox.Top = 20
LstBox.Left = 20
LstBox.Visible = False
End Sub
Private Sub LstList()
RaiseEvent MyList()
End Sub
End Class
Private Class TLBoxEditingControl
Inherits TextBox
Implements IDataGridViewEditingControl
Private DataGridViewControl As DataGridView
Private ValueIsChanged As Boolean = False
Private RowIndexNum As Integer
Dim Myg As New MyGrid()
Private Sub TlBoxEditingControl_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.TextChanged
Call Myg.LstList() ' Here I want to raise Mylist Event
Myg.LstBox.Visible = True ' Here i want to make LstBox visible
End Sub
End Class
I have added this control to a form and added this code
Private Sub MyGrid1_MyList() Handles MyGrid1.MyList
MsgBox("ggg")
End Sub
Here the event is not raising.
Thanks.