Solved

Draw a line in a form - how ?

Posted on 1998-06-24
3
179 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

816 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

13 Experts available now in Live!

Get 1:1 Help Now