Child Form: CheckBox Event

vb , net , forms Victoria, Canada
  • 12 years ago
    Hi There, I am very new to programming and started with VB 2008 Express. My knowledge is very limited but try on a little project. The project is to program a excel-like grid using a Grid Tool named Flexgrid. I included the grid on my MainForm and added a second form called FormatGrid, which contains checkboxes to format the grid. For example a check box to hide the first column. I define the grid as Grid1 As New Object under declaration of the form FormatGrid withe following code. But when I click the checkbox the column does not disappear. Using the same code but placing checkbox on the MainForm, it works. I am afraid it is trivial, but I can not figure it out to communicate between the two forms (do I need to inherited the FormatGrid form?). Hope someone can help me. Public Class FormatGrid Public Grid1 As New Object Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() End Sub Private Sub checkbox_HideColumnTitle_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboxHideColumnTitle.CheckedChanged If checkbox_HideColumnTitle.CheckState = 1 Then Grid1.Column(1).Visible = False Else : Grid1.Column(1).Visible = True End If End Sub End Class

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Some people, when confronted with a problem, think "I know, I’ll use regular expressions." Now they have two problems.” - Jamie Zawinski