基于复选框的vb.net按钮可见性

时间:2017-04-15 12:42:15

标签: vb.net button checkbox

所以我有一个表格如下:

Public Class IPADSOFT

Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
    IPADSOFTTS.Show()
End Sub

Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
    Me.Hide()
End Sub

Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
    HOME.Show()
    Me.Hide()
End Sub
End Class

有3个标签为IPADSOFTBOX1,IPADSOFTBOX2,IPADSOFTBOX3的复选框 所以...我有另一种形式如下:

Public Class IPADSOFTTS
Private Sub onload()
    If IPADSOFT.IPADSOFTBOX1.Checked Then
        Button1.Visible = True
        Button3.Visible = True
        Button5.Visible = True

    End If
End Sub
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
    Me.Hide()
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

End Sub

Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
    HOME.Show()
    IPADSOFT.Hide()
    Me.Hide()

End Sub
End Class

现在的想法是,第二个表单上的所有按钮都设置为visible-false,我希望页面检查在最后一个表单上检查了哪些复选框,然后在此表单上显示所需的按钮...但是它不工作

我做错了什么?我向vb.net道歉,非常非常新鲜

1 个答案:

答案 0 :(得分:0)

使用此

打开第二个表单
select `transactions`.`trx_id` AS `trx_id`,`transactions`.`trx_no` AS `trx_no`,`transactions`.`trx_closetime` AS `trx_closetime`,`transactions`.`trx_type` AS `trx_type`,`stocks`.`stock_id` AS `stock_id`,`stocks`.`stock_cost` AS `stock_cost`,`stock_out`.`stockout_id` AS `stockout_id`,`stock_out`.`stockout_price` AS `stockout_price`, COALESCE(`stocks`.`item_id`, `stocks_out`.`item_id`) AS `item_id from ((`transactions` left join `stocks` on(`stocks`.`trx_id` = `transactions`.`trx_id`)) left join `stock_out` on(`stock_out`.`trx_id` = `transactions`.`trx_id`)) order by `transactions`.`trx_closetime`;

+--------+---------------------+---------------------+----------+----------+------------+-------------+----------------+---------+ | trx_id | trx_no | trx_closetime | trx_type | stock_id | stock_cost | stockout_id | stockout_price | item_id | +--------+---------------------+---------------------+----------+----------+------------+-------------+----------------+---------+ | 1 | 02002-02-170415-001 | 2017-04-15 19:40:03 | 2 | 1 | 1000 | NULL | NULL | 1 | | 2 | 02002-02-170415-002 | 2017-04-15 19:40:13 | 2 | 2 | 1000 | NULL | NULL | 1 | | 3 | 02002-01-170415-001 | 2017-04-15 19:40:57 | 1 | NULL | NULL | 1 | 2000 | 1 | | 4 | 02002-02-170415-003 | 2017-04-15 19:41:14 | 2 | 3 | 1000 | NULL | NULL | 1 | +--------+---------------------+---------------------+----------+----------+------------+-------------+----------------+---------+ 设置在第二种格式的Dim newForm As New IPADSOFTTS With {.MainForm = Me} newForm .Show()

之下

然后在Load事件中使用

Public MainForm As IPADSOFT