bantamb20
asked on
vb 2008 drawline not working in Vista
What am I missing here?
I am using Visual Basic Express 2008.
I have a working pilot logbook and flight planning application, which was written, compiled, and functions well in Windows XP on my old PC.
The application uses e.graphics.drawline, e.graphics.drawcircle, e.graphics.drawarc, e.graphics.drawellipse and e.graphics.drawrectangle to draw a simple flight plan chart.
When I compile the code and run it on my new laptop (Sony Vaio VGN-NS15G) none of the lines, arcs, circles or rectangles appear. There are no runtime errors.
The rest of the programme runs fine on the laptop. It is just the graphics functions that are ignored so I am assuming it is a result of some setting or switch that I have missed to make the graphics visible on the Vista laptop.
What am I overlooking?
I am using Visual Basic Express 2008.
I have a working pilot logbook and flight planning application, which was written, compiled, and functions well in Windows XP on my old PC.
The application uses e.graphics.drawline, e.graphics.drawcircle, e.graphics.drawarc, e.graphics.drawellipse and e.graphics.drawrectangle to draw a simple flight plan chart.
When I compile the code and run it on my new laptop (Sony Vaio VGN-NS15G) none of the lines, arcs, circles or rectangles appear. There are no runtime errors.
The rest of the programme runs fine on the laptop. It is just the graphics functions that are ignored so I am assuming it is a result of some setting or switch that I have missed to make the graphics visible on the Vista laptop.
What am I overlooking?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Now that's a hobby/job I wouldn't mind having.
If the Paint event doesn't do the job, I very much doubt that the OnPaint override would do the job. I can only imagine it's an effect of the Aero interface. Not that I've seen any mention of there being issues with drawing on a form's graphics object in Vista.
If the Paint event doesn't do the job, I very much doubt that the OnPaint override would do the job. I can only imagine it's an effect of the Aero interface. Not that I've seen any mention of there being issues with drawing on a form's graphics object in Vista.
ASKER
I have re-written the map display section to draw to a bitmap and display it on a picture box. It works well thanks
[The flying (microlights) and the coding are both hobbies . . . one more expensive than the other]
ASKER
The programme now works well in Vista as well as XP with this bitmap solution, it's a sunny day ... time to go flying and turn some petrol into noise . . . cheers
ASKER
I am painting to the form using the form_paint subroutine, not OnPaint.
This process works fine in the XP environment.
First the DrawAll sub is executed, which contains the various subs to draw each portion of the flight plan. This enabled me to debug the earlier version easily, and allows users to choose various overlays, add text for latitude and longitude, names of places and so on.
All this worked fine in XP.
I have checked with breakpoints, and yes it is executing all the code.
I have attached the form_paint code, the DrawAll sub, and the simplest of the other subs it calls, the DrawBorder sub.
Your suggestions of using OnPaint and drawing to a bitmap are good ones. I will investigate and see what's involved to change the present method of drawing the plan.
I am going flying today so won't be able to complete the task now, but will get on to it asap.
Cheers
Open in new window