我在编写某些按钮时遇到问题。这是我到目前为止所得到的:
Public Class Form1
Dim Button(12) As Button
Dim X As Integer
Private Sub EventName()
Dim message, title, defaultValue As String
Dim myValue As Object
If Label4.Text = "Admin" Then
' Set prompt.
Message = "Enter Product Name"
' Set title.
title = "Product Name"
defaultValue = "" ' Set default value.
'Display message, title, and default value.
myValue = InputBox(Message, title, defaultValue)
Button(X).Text = myValue
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button9.Click, Button8.Click, Button7.Click, Button6.Click, Button5.Click, Button4.Click, Button3.Click, Button2.Click, Button12.Click, Button11.Click, Button10.Click
'Dim message, title, defaultValue As String
'Dim myValue As Object
For Me.X = 1 To 10
>>>>> <<<<<<<
Next
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button(1) = Button1
Button(2) = Button2
Button(3) = Button3
Button(4) = Button4
Button(5) = Button5
Button(6) = Button6
Button(7) = Button7
Button(8) = Button8
Button(9) = Button9
Button(10) = Button10
Button(11) = Button11
Button(12) = Button12
End Sub
我想要做的是,如果我单击按钮 7,则会出现一个输入框供用户输入按钮的名称。无论我在 之间尝试了什么>>>>> <<<<<
,我似乎都无法做到正确。