Solved

Draw a line in a form - how ?

Posted on 1998-06-24
3
176 Views
Last Modified: 2010-05-03
I wrote: "form1.Line(0,0)-(200,200), RGB(0,0,255)", and even put a "form1.refresh", but when "form1.show" is executed, there is no line drawn !?!! Can someone shower some help ? Thanks !!
0
Comment
Question by:collinng
3 Comments
 

Accepted Solution

by:
electrick earned 50 total points
ID: 1464159
You must invoke Show() before you draw the line. In other words,
you have to have a form displayed before you can draw on it.

0
 
LVL 2

Expert Comment

by:swilt
ID: 1464160
A form is only displayed when .show is executed or End Sub of the form load is reached

the following code will work

Private Sub Form_Load()
    Form1.Show
    Form1.Line (0, 0)-(200, 200), RGB(0, 0, 255)
End Sub


OR


Private Sub Form_Paint()
    Form1.Line (0, 0)-(200, 200), RGB(0, 0, 255)
End Sub

0
 

Author Comment

by:collinng
ID: 1464161
Electrick and Swilt are both correct. In addition, I can also draw a line after show() - as long as the instructions are not in Form_Load() module. However, I still don't understand why Line instruction in Form_Load() module doesn't work - but nebermine, that's just too detailed to bother about. Thanks so much, I appreciate it !
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now