Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: Zorder for the Line Method

104| Sat, 01 Dec 2007 20:36:00 GMT| robdon| Comments (5)
Hi,

I have a Frame and want to draw some lines on it.

I dont want to create a line Control because there are too many of them.

I've tried to use the line method, ie Form1.line (1,1)-(100,100)

The problem with this is that the line method seems to draw the lines UNDER the frame controle.

How do I make it draw the lines on top of the frame control, or change the Zorder.

Thanks,

Rob Donovan.

Keywords & Tags: zorder, line, method, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/560835/
 
«« Prev - Next »» 5 helpful answers below.
Simple - you can't.

It's just not possible. You would have to make your own line control OR subclass the frame and draw the line over the frame. Otherwise, you can't.

What you can do, however, is to add ANOTHER line control on the frame and make it connect the part covered by the frame.

microbasic | Mon, 03 Dec 2007 21:55:00 GMT |

or use API and draw directly onto the desktop.

buggyprogrammer | Mon, 03 Dec 2007 21:56:00 GMT |

Wouldnt it be easier to use a Picture box instead of a frame and then draw directly on it using .Line

beachbum | Mon, 03 Dec 2007 21:57:00 GMT |

beachbum scored a hit. use the picturebox. it can hold controls too.

snakeeyes1000 | Mon, 03 Dec 2007 21:58:00 GMT |

Originally posted by Microbasic
Simple - you can't.

It's just not possible. You would have to make your own line control OR subclass the frame and draw the line over the frame. Otherwise, you can't.

What you can do, however, is to add ANOTHER line control on the frame and make it connect the part covered by the frame. Here you have the explanation needed to backup Microbasic's affirmation:
Three graphical layers are associated with forms andcontainers. The back layer is the drawing space where the results of the graphics methods are displayed. Next is the middle layer where graphical objects and Label controls are displayed. The front layer is where all nongraphical controls like CommandButton, CheckBox, or ListBox are displayed. Anything contained in a layer closer to the front covers anything contained in the layer(s) behind it. ZOrder arranges objects only within the layer where the object is displayed.

mcbrain | Mon, 03 Dec 2007 21:59:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories