VB6.0中用line画的线可以在单击事件显示,但不能在加载事件中显示

下面这些写在窗体加载事件(Form_Load())中运行后看不到图像
但是写在Form_Click中一单击图像就出来了,这是为什么呢?
Dim pi as Single
Form1.Cls
For i = 0 To 12 Step 1
Line (11 * Sin(pi * i / 6), 11 * Cos(pi * i / 6))-(13 * Sin(pi * i / 6), 13 * Cos(pi * i / 6)), RGB(20 * i, 200, 154) '添加12条整点的时间线
Next i
For i = 0 To 120 Step 2
Line (12 * Sin(pi * i / 60), 12 * Cos(pi * i / 60))-(13 * Sin(pi * i / 60), 13 * Cos(pi * i / 60)) '添加60条刻度
Next i

For i = 1 To 12 Step 1
If i = 12 Then
CurrentX = -0.5: CurrentY = 10: Print "12";
ElseIf i = 6 Then
CurrentX = -0.5: CurrentY = -10: Print "6";

Else
CurrentX = 11 * Sin(pi * i / 6): CurrentY = 11 * Cos(pi * i / 6): Print i
End If

formload是窗体加载的同时完成一些功能,所以不能显示
你可以将属性 AutoRedraw 设为 True就可以写到formload了
温馨提示:内容为网友见解,仅供参考
无其他回答

VB6.0中用line画的线可以在单击事件显示,但不能在加载事件中显示
formload是窗体加载的同时完成一些功能,所以不能显示 你可以将属性 AutoRedraw 设为 True就可以写到formload了

...的函数是哪个?vb6.0是picture1.line就可以,但是vb.net没有啊_百度...
'记录鼠标左键点击的位置,第二次点击后开始绘制直线 Private Sub Pic1_MouseDown()Sub Pic1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Pic1.MouseDown If e.Button = Windows.Forms.MouseButtons.Left Then If Not ShouldDrawLine Then PtStart = ...

VB6.0编程,在picture1里画一条p关于h的曲线,line画的好像不对,而且无法...
Picture1.Line -(h, p), vbRed 改为 Picture1.Line -(p, h), vbRed 看看行不?因为公式比较复杂,你的代码也不全,我这里无法测试。另外,你的For循环的步长0.05太小了,即使用画点的方式也不可能画出虚线来的,你可以想象一下:在一个针尖大小的范围内画一条虚线是什么感觉?

VB6.0中如何让下面这段代码的结果显示在text窗口
用字符串连接起来就可以了,把TextBox控件的MultiLine属性设置为True 可以分行显示 dim str as string str="Private Sub 计算_Click()“ & vbcrlf str=str & "w1 = ComboBox1.Text" & vbcrlf str=str & "w2 = ComboBox2.Text" & vbcrlf str=str & "w3 = ComboBox3.Text" & vbcrlf...

vb6.0怎样将保存的txt文件给数组赋值,并显示在text控件里?代码怎么写...
回答:好难啊,我看看书

VB6.0中Line函数的使用.
If k = 1 Then Line (Shape1.Left, Shape1.Top)-(X, Y)Shape1.Left = X Shape1.Top = Y End If End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)k = 0 End Sub 试试这个行不行?还是有相同的设置。form1.autodraw=true等 ...

vb6.0 在窗体中指定区域绘图
要在规定的地方绘图,绘图完后,将不需要的地方抹去。Private Sub Form_Click()'单击窗体,画随机的点 Dim x As Single, y As Single, I As Long Me.DrawWidth = 20: Me.AutoRedraw = True Me.Cls For I = 0 To 2000 Randomize: x = Rnd * Me.ScaleWidth Randomize: y = Rnd * Me...

VB6.0中使用line input #1循环赋值给数组的问题.
Private Sub Command1_Click()Dim X() As Double '存储X坐标 Dim Y() As Double '存储Y坐标 Dim i As Integer Dim tempStr As String '存储文本行值 Open App.Path & "\\123.txt" For Input As #1 Do While Not EOF(1)Line Input #1, tempStr i = i + 1 ReDim Preserve ...

怎么在VB6.0中实现LINE多线控件自动画线.
是不是动态添加来画? private sub command1_click dim l as vb.line static i& set l=controls.add("vb.line","l" & i) i=i+1 with l .x1=i*.150 .y1=i*120 .x2=.x1+1500 .y2=.y1+1200 .visible=true end with end sub ...

...里面怎么实现开关功能?如图,能不能通过单击line实现?
窗体上用Line控件画四根线,上下两根竖线是Line1,Line2,开关那根是Line3:Private Sub Form_Click()Static a As Boolean, x As Integer, y As Integer If a Then Line3.X2 = x Line3.Y2 = y Else x = Line3.X2 y = Line3.Y2 Line3.X2 = Line2.X1 Line3.Y2 = Line2.Y1 ...

相似回答
大家正在搜