Click here to Skip to main content
15,918,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do i draw lines and curves on a form from within a running program
in vb2008.
Also stuck with creating variables which are seen throughout app.

Needed for personal project, any help will be helpful.
Thanks
Posted
Updated 17-May-10 18:01pm
v2

I can't give you the VB code - I use C#, but it is the same stuff under the hood.

To draw lines and curves, handle the forms Paint event. It has an EventArgs parameter, which contains a Graphics object.
The Graphics object supports functions like DrawLine, DrawArc, etc. which are what you need to use.

In C# we can't create global variables, and I suspect VB is the same - instead we make them part of the form or other class and access them that way.
 
Share this answer
 
Comments
William Winner 17-May-10 16:31pm    
actually, in VB, you can do a global variable. All you have to do is create a module and then declare a Public variable within that. Any public variable within the module will be visible to the whole project.
Drawing lines - here.

Variables that need to be seen throughout app - use Public.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900