Results 1 to 8 of 8

Thread: Logic for filling circles in a rectangle

  1. #1

    Thread Starter
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Logic for filling circles in a rectangle

    Hi All,

    I am struggling with coding up a bit of logic.

    I have a map which I have created zones which are basically rectangles which have the coordinates sorted

    eg
    Zone 1
    Zone 2
    Zone 3

    I then want to create circles within the rectangles. So for example
    Item1, Zone1
    Item2, Zone1
    Item3, Zone3
    Item4, Zone2
    Item5, Zone1

    So i would like Item 1, 2 and 5 to show up as three circles and when the mouse cursor floats over them to show it. The item list is dynamic and so I am not sure how to get about with this?

    Has anyone got an idea?
    If you find my thread helpful, please remember to rate me

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Logic for filling circles in a rectangle

    You not only want to just draw the circles, but also respond to mouse events. So it should be object instead of just plain graphics.
    I recommen you download and install the Visual Basic PowerPacks which has some shape type controls like RectangleShape, OvalShape and LineShape which you can put to use.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  3. #3

    Thread Starter
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: Logic for filling circles in a rectangle

    How difficult is it to use these powerpacks?
    If you find my thread helpful, please remember to rate me

  4. #4

    Thread Starter
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: Logic for filling circles in a rectangle

    I've got as far as the rectangle zones, but i need the circles to fill inside these rectangles...
    If you find my thread helpful, please remember to rate me

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Logic for filling circles in a rectangle

    You might like to follow CodeBank link in my signature and check out my Manipulating GDI+ thread.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Logic for filling circles in a rectangle

    Quote Originally Posted by dinosaur_uk View Post
    How difficult is it to use these powerpacks?
    If you know how to use a TextBox or Label, this is no different. I think even easier.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  7. #7

    Thread Starter
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098

    Re: Logic for filling circles in a rectangle

    Yeah, but i need draw at runtime and the number of circles in the zone is dynamic
    If you find my thread helpful, please remember to rate me

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Logic for filling circles in a rectangle

    Quote Originally Posted by dinosaur_uk View Post
    Yeah, but i need draw at runtime and the number of circles in the zone is dynamic
    If you can add a TextBox to a form at run time you can add a shape.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width