Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyRight Then
Picture1.Left = Picture1.Left + 100
End If
If KeyCode = vbKeyLeft Then
Picture1.Left = Picture1.Left - 100
End If
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.Circle (X, Y), 300
End Sub
你要控制你的圆在一个容器里面移动吧
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer
Dim max As Integer, min As Integer
a = Val(InputBox("输入第1个整数", "Input"))
b = Val(InputBox("输入第2个整数", "Input"))
c = Val(InputBox("输入第3个整数", "Input"))
max = a
If b >max Then max = b
If c >max Then max = c
min = a
If b If c
Print max, a + b + c - max - min, min
End Sub
弄个richtextbox,输入的整数用逗号“,”隔开,比如123,45,67,89这样,然后
排序按钮代码
private void button1_Click(object sender, EventArgs e)
{
string str = richTextBox1.Text.Replace(" ","").TrimEnd(new char[]{','});
if (!string.IsNullOrEmpty(str.Trim(("1234567890,").ToCharArray())))
{
MessageBox.Show("输入数据不正确!");
return;
}
string[] strs = str.Split(new char[] { ',' });
int[] lint = new int[strs.Length];
for (int i = 0; i
lint[i] = int.Parse(strs[i]);
Array.Sort(lint);
richTextBox1.AppendText("rn从小到大排序为:rn");
foreach (int i in lint) richTextBox1.AppendText(i + ",");
}
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Click()
n = CInt(InputBox("请输入一个奇数", "数据输入"))
For i = 1 To n
Print Tab(51 - i);
For j = 1 To 2 * i - 1
Print Trim(Str(n Mod 10));
Next j
Next i
For i = n - 1 To 1 Step -1
Print Tab(51 - i);
For j = 1 To 2 * i - 1
Print Trim(Str(n Mod 10));
Next j
Next i
End Sub
Private Sub Form_Load()
Me.FontSize = 19
Label1.FontSize = 19
Me.WindowState = 2
Me.Caption = "xxxxxx"
Label1.Caption = "xxxx"
End Sub
以上是VB窗口中绘制圆形,通过不同的xy输入来改变圆的位置,并通过键盘控制圆形运动的详细内容。更多信息请关注PHP中文网其他相关文章!