Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Draw a line in a form - how ?

Posted on 1998-06-24
3
Medium Priority
?
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
electrick earned 150 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

688 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