AllExperts > Experts 
Search      

VB.NET

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More VB.NET Answers
Question Library

Ask a question about VB.NET
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Brandon Drake
Expertise
I can answer questions regarding the Graphics object, file access, general optimization, printing (on paper), user controls, program mathematics, the registry, creating macros, processes, and fundamental or basic questions. I have made a few asp.net pages but I do not know the language extensively. I have not done much work with databases but I have created my own database systems.

Experience
I have been programming with visual basic for 6 years. In all I have written programs in about 8 programming languages, although, I only know about 3 well. I have written a few applications but mainly I like to write programs for fun.

 
   

You are here:  Experts > Computing/Technology > Basic > VB.NET > Drawing a line With VB.net 2005

Topic: VB.NET



Expert: Brandon Drake
Date: 8/13/2006
Subject: Drawing a line With VB.net 2005

Question
I have made a slot machine using VB.net 2005 Express and I want to draw a thick line through my three pictureboxes when 3 of any alike symbols are rolled in.

I will want to make a sub called Drawline. How will I get the line(rectangle) ontop of all of the controls as each picture box has a larger label behind that changes color when 3 alike symbols roll in the pictureboxes to give the picture boxes a highlighted effect. SO I am assuming there must be a master command that places what we render ontop of all controls.

Another problem I am having is when I create lines using my book examples I do not know how to call them as they need to be put in the forms paint event so that they persist.

This was so easy in VB6. :/ lol


I would really appreciate your with this. I am a newbie so please try to answer in lamen's terms.

Thank you  

Answer
Trent,

I think what you need to do is create a long picture box and change the visibility of that.  The picture box would have the background set to a certain color and have the border style set to none.

If you are drawing on the form, in order to get the drawings to persist you need to use the forms Paint() event.  You can write all of the code in there used to generate the graphics and every time the form is redrawn the paint function will be called.



Good Luck,

Brandon Drake

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.