By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

newbie graphics

P: n/a
I found the following method in a graphics turtorial..

private void DrawShapesForm_Paint(object sender, PaintEventArgs e)

{

// references to object we will use

Graphics graphicsObject = e.Graphics;

// ellipse rectangle and gradient brush

Rectangle drawArea1 = new Rectangle( 5, 35, 30, 100 );

LinearGradientBrush linearBrush =

new LinearGradientBrush ( drawArea1, Color.Blue,

Color.Yellow, LinearGradientMode.ForwardDiagonal );
// draw ellipse filled with a blue-yellow gradient

graphicsObject.FillEllipse( linearBrush, 5, 30, 65, 100 );

}

My question is. What code should I put into the click event of
a command button to get it to execute from there?
TIA Mick.
Nov 19 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Tue, 18 Nov 2008 18:41:12 -0800, Michael <mi*****@bigpond.comwrote:
[...]
My question is. What code should I put into the click event of
a command button to get it to execute from there?
None. Just assign that method as the handler for the Paint method of your
Control or Form. The method will be called as necessary any time there's
a need to draw the graphics that code represents.

Pete
Nov 19 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.