Gcnew System::Drawing::Font( "Arial",10 ), System::Drawing::Brushes::Blue, Point(30,30) ) G->DrawString( "This is a diagonal line drawn on the control", Create a local version of the graphics object for the PictureBox. ![]() Void pictureBox1_Paint( Object^ /*sender*/, System::Windows::Forms::PaintEventArgs^ e ) Add the PictureBox control to the Form. PictureBox1->Paint += gcnew System::Windows::Forms::PaintEventHandler( this, &Form1::pictureBox1_Paint ) Connect the Paint event of the PictureBox to the event handler method. Dock the PictureBox to the form and set its background to white. Void Form1_Load( Object^ /*sender*/, System::EventArgs^ /*e*/ ) connected to the Load event of the form. This example assumes that the Form_Load event handler method is This example creates a PictureBox control on the form and draws to it. The following code example creates a PictureBox control on the form and uses the Paint event to draw to it. ![]() public:Įvent System::Windows::Forms::PaintEventHandler ^ Paint public event Paint public event ? Paint member this.Paint : Public Custom Event Paint As PaintEventHandler Event Type PaintEventHandler Examples
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |