Click here to Skip to main content
13,632,868 members
Rate this:
Please Sign up or sign in to vote.
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.
Posted 17-May-10 9:22am
Updated 17-May-10 18:01pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Drawing lines - here.

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.180712.1 | Last Updated 18 May 2010
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100