本文介绍了在Panel C#Windows窗体上绘图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我在设计上有误,请纠正或建议我采用正确的方法..
我创建了一个小作业.我需要您的建议才能运行该应用程序.
由于我之前的mfc代码是不受管理的,并且以相同的方式思考,因此
所以我对使用托管C#代码感到困惑.
内容是
Mainform类:-贯穿包含2个面板的主应用程序.
全局类:-
Hi,
Please correct if I am wrong in Design or suggest me to go through right way..
I have created one small assignment. and i need your suggestions to work that application.
As my previous mfc code was unmanaged and thinking the same way,
so I m getting little confused to work with managed c# code.
Contents are
Mainform class:- which runs through main application which contains 2 panels.
Global class:-
DrawShape(Line object, Graphics gObject)
{
object.Draw(gObject);
}
线路类别:-
Line class:-
public void Draw(Graphics object);
Form1类:-其独立形式.包含一个按钮
Form1 class:- Its independent form. contains one button
On button Click()
{
Line object = new Line();
//TODO:
//I want to draw the line on mainform''s panel for
//that i need Graphics object of Mainform.panel.
// Global.DrawShape(object, GraphicsObject);
}
推荐答案
这篇关于在Panel C#Windows窗体上绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!