
Option Explicit
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Sub Form_Load()
SetWindowPos Form1.hwnd, -1, 0, 0, 0, 0, 3
End Sub
这样就不会被覆盖了
Loop: 与 goto 一起形成一个循环,goto 在行上添加一个标签来指示、转到、在标签处执行,loop 通常用作标签。 在程序结束时添加一个 pause 语句(如系统暂停)或一个 input 语句(如 getch)用goto语句。
#include<stdio.h>
void main()
{
int a
begin: scanf("%d", &a) // goto语句的标号begin
if(a<0 || a>9)
goto begin // 如果用户输入的数不在0~9之间,则重新输入
eles
printf("%d\n", a) // 如果用户输入的数在0~9之间,则输出该数
}
扩展资料:goto的基本语法
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i = 1
while(1)
{
printf("在while(1)里\n")
while(i++)
{
printf("i = %d\n",i)
if(i >3)
{
goto TiaoChu
}
}
}
TiaoChu:
printf("程序结束\n")
return 0
}
运行结果:
标号位置
在while(1)里
2
3
4
程序结束
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)