left.top,scaleleft,scaletop 区别是什么? 什么是递归函数? 用4句代码编写一个调色板? 实现每次单击窗体时,窗体右移100提怎么写? 谢谢!LEFT 子目标对于父目标的左边距.如控件在窗体中的左边距,窗体对于屏幕左边距. TOP 子目标对于父目标的顶边距.如控件在窗体中的顶边距,窗体对于屏幕面边距. scaleleft,scaletop 当使用图形方法或调整控件位置时,返回或设置一个对象左边和上边水平 (ScaleLeft) 和垂直 (ScaleTop) 的坐标。 即,LEFT,TOP是控件对控件的容器的左,顶距.scaleleft,scaletop是自已的"可用"边距,顶距.递归就是自身调用自身. 例如: FUNCTION LOOPFUN() CALL LOOPFUN() '在这里调用自己. END FUNCTION 每一个递归函数都有一个出口,否则会开成无限递归过程. 如: FUNCTION LOOPFUN(K AS LONG ) K=K+1 IF K>=200 THEN EXIT FUNCTION '递归出口,当K>=200时,则结束递归过程. CALL LOOPFUN() '在这里调用自己. END FUNCTION关于如何用四句话写一个调色板,你只有加载通用对话框控件了. 如果不限于四句话,可以用一个PICTUREBOX生成一个调色板.' '建立一个调色板. '函数名: CreateColorPal '入口参数: ColorPic As Object '说明:ColorPic 欲设置成调色板的对象名 '作用: 将一个对象设置成一个调色板 '如:CreateColorPal PICTURE1 Public Sub CreateColorPal(ColorPic As Object) Dim I As Long ColorPic.AutoRedraw = True ColorPic.Scale (0, 0)-(16, 3) Colors = Array(16777215, 14737632, 12632319, 12640511, _ 14745599, 12648384, 16777152, 16761024, _ 16761087, 192, 16576, 49344, _ 49152, 12632064, 12582912, 12583104, _ 12632256, 4210752, 8421631, 8438015, _ 8454143, 8454016, 16777088, 16744576, _ 16744703, 128, 16512, 32896, _ 32768, 8421376, 8388608, 8388736, _ 8421504, 0, 255, 33023, _ 65535, 65280, 16776960, 16711680, _ 16711935, 64, 4210816, 16448, _ 16384, 4210688, 4194304, 4194368)
For I = 0 To 15 ColorPic.Line (I, 0)-(I + 1, 1), Colors(I), BF ColorPic.Line (I, 1)-(I + 1, 2), Colors(I + 16), BF ColorPic.Line (I, 2)-(I + 1, 3), Colors(I + 32), BF If I > 0 Then ColorPic.Line (I, 0)-(I, 3) End If Next I ColorPic.Line (0, 1)-(16, 1) ColorPic.Line (0, 2)-(16, 2) End Sub 实现每次单击窗体时,窗体右移100提怎么写? SUB FORM_CLICK() ME.LEFT=ME.LEFT-100 END SUB
Top-返回或设置对象的内顶部和它的容器的顶边之间的距离。
当使用图形方法或调整控件位置时,返回或设置一个对象左边和上边水平 (ScaleLeft) 和垂直 (ScaleTop) 的坐标。递归函数:就是自调用函数,在函数体内部直接或间接的调用自己,即函数的嵌套调用是函数本身。用一个CommonDialog控件
CommonDialog1.ShowColorform_click
form1.left=form1.left+100
什么是递归函数?
用4句代码编写一个调色板?
实现每次单击窗体时,窗体右移100提怎么写?
谢谢!LEFT 子目标对于父目标的左边距.如控件在窗体中的左边距,窗体对于屏幕左边距.
TOP 子目标对于父目标的顶边距.如控件在窗体中的顶边距,窗体对于屏幕面边距.
scaleleft,scaletop 当使用图形方法或调整控件位置时,返回或设置一个对象左边和上边水平 (ScaleLeft) 和垂直 (ScaleTop) 的坐标。
即,LEFT,TOP是控件对控件的容器的左,顶距.scaleleft,scaletop是自已的"可用"边距,顶距.递归就是自身调用自身.
例如:
FUNCTION LOOPFUN() CALL LOOPFUN() '在这里调用自己.
END FUNCTION
每一个递归函数都有一个出口,否则会开成无限递归过程.
如:
FUNCTION LOOPFUN(K AS LONG )
K=K+1
IF K>=200 THEN EXIT FUNCTION '递归出口,当K>=200时,则结束递归过程.
CALL LOOPFUN() '在这里调用自己.
END FUNCTION关于如何用四句话写一个调色板,你只有加载通用对话框控件了.
如果不限于四句话,可以用一个PICTUREBOX生成一个调色板.'
'建立一个调色板.
'函数名: CreateColorPal
'入口参数: ColorPic As Object
'说明:ColorPic 欲设置成调色板的对象名
'作用: 将一个对象设置成一个调色板
'如:CreateColorPal PICTURE1
Public Sub CreateColorPal(ColorPic As Object)
Dim I As Long
ColorPic.AutoRedraw = True
ColorPic.Scale (0, 0)-(16, 3)
Colors = Array(16777215, 14737632, 12632319, 12640511, _
14745599, 12648384, 16777152, 16761024, _
16761087, 192, 16576, 49344, _
49152, 12632064, 12582912, 12583104, _
12632256, 4210752, 8421631, 8438015, _
8454143, 8454016, 16777088, 16744576, _
16744703, 128, 16512, 32896, _
32768, 8421376, 8388608, 8388736, _
8421504, 0, 255, 33023, _
65535, 65280, 16776960, 16711680, _
16711935, 64, 4210816, 16448, _
16384, 4210688, 4194304, 4194368)
For I = 0 To 15
ColorPic.Line (I, 0)-(I + 1, 1), Colors(I), BF
ColorPic.Line (I, 1)-(I + 1, 2), Colors(I + 16), BF
ColorPic.Line (I, 2)-(I + 1, 3), Colors(I + 32), BF If I > 0 Then
ColorPic.Line (I, 0)-(I, 3)
End If
Next I
ColorPic.Line (0, 1)-(16, 1)
ColorPic.Line (0, 2)-(16, 2)
End Sub
实现每次单击窗体时,窗体右移100提怎么写?
SUB FORM_CLICK()
ME.LEFT=ME.LEFT-100
END SUB