我怎麼能叫與系統參數的方法在鼠標點擊事件:呼叫信息與鼠標點擊事件參數的方法
public void DrawStringRectangleF(PaintEventArgs e)
{
// Create string to draw.
String drawString = "Sample Text";
// Create font and brush.
Font drawFont = new Font("Arial", 16);
SolidBrush drawBrush = new SolidBrush(Color.Black);
// Create rectangle for drawing.
float x = 150.0F;
float y = 150.0F;
float width = 200.0F;
float height = 50.0F;
RectangleF drawRect = new RectangleF(x, y, width, height);
// Draw rectangle to screen.
Pen blackPen = new Pen(Color.Black);
e.Graphics.DrawRectangle(blackPen, x, y, width, height);
// Draw string to screen.
e.Graphics.DrawString(drawString, drawFont, drawBrush, drawRect);
}
我想打電話給在此情況下,本方法:
private void button1_Click(object sender, EventArgs e)
{
// calling DrawStringRectangleF(PaintEventArgs e) here
}
如果參數只是在調用這些方法時提及這些值,則很容易調用該方法,但在這種情況下如何調用它?!
入住此線程: 的http://計算器.COM /問題/ 11753345 /如何撥號功能與 - PaintEventArgs的-argumnt –