Graphic guage level C#(newbie)

  • Thread starter Thread starter jed
  • Start date Start date
J

jed

What would be the easiest way to program a graphic guage to represent
the level of a tank.Please tell me if there is a add-on to C# that
assists you on graphic drawings.For example i need a rectangle
with a color that fills it; with a textbox at the bottom of the form
to specify to what level that the color must fill.thanks
 
Hi!

What would be the easiest way to program a graphic guage to represent
the level of a tank.Please tell me if there is a add-on to C# that
assists you on graphic drawings.For example i need a rectangle
with a color that fills it; with a textbox at the bottom of the form
to specify to what level that the color must fill.thanks

I suppose you can use the classes available in System.Drawing
Namspace.

For example use a the graphics object to Create a Rectangular Guage.
Then on the Text Changed Event of Text Box Fill the Rectangle with
some color according to the percentage specified in the TextBox.
This can be acheived using simple Fill Methods.

Look for Graphics Object Members in MSDN Library.


Manu Singhal
MCP (.net)
(e-mail address removed)
 
What would be the easiest way to program a graphic guage to represent
the level of a tank.Please tell me if there is a add-on to C# that
assists you on graphic drawings.For example i need a rectangle
with a color that fills it; with a textbox at the bottom of the form
to specify to what level that the color must fill.thanks

Have a look at the System.Drawing namespace. The way I would do this is to
add a usercontrol to the project, call it TankGauge or something. Create a
module level variable to store the level and create properties to change the
level. Override OnPaint and draw the tank in there. Then when they change
the level call this.Invalidate()

Michael
 
What would be the easiest way to program a graphic guage to represent
the level of a tank.Please tell me if there is a add-on to C# that
assists you on graphic drawings.For example i need a rectangle
with a color that fills it; with a textbox at the bottom of the form
to specify to what level that the color must fill.thanks

I forgot to mention when you draw you just use commands like
e.Graphics.FillRectangle etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top