Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Filling in Circles


Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2003, 07:02 AM
TheScott18 TheScott18 is offline
Regular
 
Join Date: Oct 2002
Location: New Jersey, USA
Posts: 59
Default Filling in Circles


In order to make a filled box, you do this:

form1.line (x1,y1) - (x2,y2), , BF

How do I go about making a filled circle?
Reply With Quote
  #2  
Old 01-13-2003, 07:04 AM
Garmour's Avatar
Garmour Garmour is offline
Back for a little while..

Retired Leader
* Expert *
 
Join Date: Oct 2002
Location: Behind you.....Boo
Posts: 2,199
Default

Read the vb help

The first line in the remarks begins....
Quote:
Remarks

To fill a circle, set the FillColor and FillStyle properties of the object on which the circle or ellipse is drawn. Only a closed figure can be filled. Closed figures include circles, ellipses, or pie slices (arcs with radius lines drawn at both ends).
Hope that helps..
__________________

....but then, what would I know ?
Reply With Quote
  #3  
Old 01-13-2003, 07:06 AM
TheScott18 TheScott18 is offline
Regular
 
Join Date: Oct 2002
Location: New Jersey, USA
Posts: 59
Default

but what's the syntex to filling them?
Reply With Quote
  #4  
Old 01-13-2003, 07:08 AM
Garmour's Avatar
Garmour Garmour is offline
Back for a little while..

Retired Leader
* Expert *
 
Join Date: Oct 2002
Location: Behind you.....Boo
Posts: 2,199
Default

huh ???

Quote:
set the FillColor and FillStyle properties of the object on which the circle
So that would be your form1
ie, form1.fillcolor
__________________

....but then, what would I know ?
Reply With Quote
  #5  
Old 01-13-2003, 07:09 AM
TheScott18 TheScott18 is offline
Regular
 
Join Date: Oct 2002
Location: New Jersey, USA
Posts: 59
Default

Ok, I get it. It's not like with boxes that there's a peramtier that you can set. Thanks.
Reply With Quote
  #6  
Old 01-13-2003, 07:11 AM
Garmour's Avatar
Garmour Garmour is offline
Back for a little while..

Retired Leader
* Expert *
 
Join Date: Oct 2002
Location: Behind you.....Boo
Posts: 2,199
Default

No, it's not like boxes. It's the way it says in the help

Quote:
Remarks

To fill a circle, set the FillColor and FillStyle properties of the object on which the circle or ellipse is drawn. Only a closed figure can be filled. Closed figures include circles, ellipses, or pie slices (arcs with radius lines drawn at both ends).
__________________

....but then, what would I know ?
Reply With Quote
  #7  
Old 01-13-2003, 07:35 AM
mjs7231 mjs7231 is offline
Junior Contributor
 
Join Date: Dec 2002
Posts: 215
Default

Is there a way to create an object of circle on the fly, with a variable name and everything to use later?
Reply With Quote
  #8  
Old 01-13-2003, 08:05 AM
Garmour's Avatar
Garmour Garmour is offline
Back for a little while..

Retired Leader
* Expert *
 
Join Date: Oct 2002
Location: Behind you.....Boo
Posts: 2,199
Default

Try not to hijack another thread.

I don't think you can create shapes as controls but you could create a variable to keep track of all the essential details.
ie,
private type myshape
x as integer
y as integer
radius as integer
colour as long
end type ??
__________________

....but then, what would I know ?
Reply With Quote
  #9  
Old 01-13-2003, 08:06 AM
Machaira's Avatar
Machaira Machaira is offline
Jedi Coder

* Expert *
 
Join Date: Aug 2002
Location: Abingdon, MD
Posts: 3,438
Default

Try something like:
Code:
Private Sub Command1_Click() Dim obj As Shape Static iLeft As Integer Static iTop As Integer Static iNum As Integer iNum = iNum + 1 Set obj = Me.Controls.Add("VB.Shape", "shp" & iNum) obj.Shape = vbShapeCircle obj.BackColor = vbRed obj.Visible = True iLeft = iLeft + 500 iTop = iTop + 500 obj.Left = iLeft obj.Top = iTop obj.Width = 250 obj.Height = 250 End Sub
After creating the control, reference it using the Controls collection and the name - i.e. shp<n>

See here for more info - http://vb.oreilly.com/ron/dynamic.html
Reply With Quote
  #10  
Old 01-13-2003, 10:43 AM
mjs7231 mjs7231 is offline
Junior Contributor
 
Join Date: Dec 2002
Posts: 215
Default

i wasn't hijacking, I dont think..
His question was done, i was continuing on from it, He most likly will be able to use this information too
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->