我试图在选中文本框时将一组 30 个按钮向下移动 100 像素(然后在未选中该框时返回它们的原点)。如果用户需要,这是为按钮下方的一些标签提供空间......就像这里的“显示提示”框:http ://www.phonemicchart.com/
我有以下代码:
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
Button5.Location = New Point(100, 100)
Label1.Visible = False
Else
Button5.Location = New Point(300, 300)
Label1.Visible = True
End If
End Sub
问题是 New Point() 函数。我想要的新点是相对于原点的 -100px,然后是 Else 语句,它是 Button5.Location = Origin。
我可以使用哪些命令来实现这一点?