1个回答
展开全部
我又来了。。。
你是指VS2010中VC++的Windows窗体应用程序吗?
如果是,那:
在void InitializeComponent(void)函数中添加如下语句(或者直接在窗体事件里选Paint事件):
this->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &Form1::Form1_Paint);
然后在后面在添加个这样的函数:
private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
Graphics^ g=e->Graphics;
System::Drawing::Font ^ ft = gcnew System::Drawing::Font(L"Times New Roman", 28, FontStyle::Bold); //字体Times New Roman,大小28,黑体
g->DrawString(L"a", ft, Brushes::Black, 50 ,50 ); //绘制的字符串"a",黑色,位置(50,50)
}
你是指VS2010中VC++的Windows窗体应用程序吗?
如果是,那:
在void InitializeComponent(void)函数中添加如下语句(或者直接在窗体事件里选Paint事件):
this->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &Form1::Form1_Paint);
然后在后面在添加个这样的函数:
private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
Graphics^ g=e->Graphics;
System::Drawing::Font ^ ft = gcnew System::Drawing::Font(L"Times New Roman", 28, FontStyle::Bold); //字体Times New Roman,大小28,黑体
g->DrawString(L"a", ft, Brushes::Black, 50 ,50 ); //绘制的字符串"a",黑色,位置(50,50)
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询