Want to draw a line on a Form with C++/CLI
-
I have a beginners question. What does the code look like to use DrawLine in C++ CLI? -- thanks
Here's one way: Graphics^graphics = CreateGraphics(); Pen AzurePen(Color::Azure); graphics->DrawLine(%AzurePen, 10, 10, 50, 50); Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Here's one way: Graphics^graphics = CreateGraphics(); Pen AzurePen(Color::Azure); graphics->DrawLine(%AzurePen, 10, 10, 50, 50); Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Of course, this line will disappear as soon as the form is invalidated. All drawing should occur in the paint event
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Of course, this line will disappear as soon as the form is invalidated. All drawing should occur in the paint event
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Heh! I didn't say where to put the code, nor was I asked! LOL
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Heh! I didn't say where to put the code, nor was I asked! LOL
Mark Salsbery Microsoft MVP - Visual C++ :java:
Actually, IMHO, you shouldn't give too much more information than they ask for. You learn more from trying and failing (a.k.a. experience) than someone telling you as a by-the-way comment.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
Actually, IMHO, you shouldn't give too much more information than they ask for. You learn more from trying and failing (a.k.a. experience) than someone telling you as a by-the-way comment.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
Also, I find the distance I drift away from what the OP really wanted is often directly proportional to the amount of example code I type and/or copy :) Cheers, Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Also, I find the distance I drift away from what the OP really wanted is often directly proportional to the amount of example code I type and/or copy :) Cheers, Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Word!
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
Heh! I didn't say where to put the code, nor was I asked! LOL
Mark Salsbery Microsoft MVP - Visual C++ :java:
Hi Mark, your code was not targetting the paint handler, it includes a CreateGraphics(), whereas A paint handler would hand you the Graphics to use ! Greetings
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
Hi Mark, your code was not targetting the paint handler, it includes a CreateGraphics(), whereas A paint handler would hand you the Graphics to use ! Greetings
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
Indeed! Thanks Luc :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Actually, IMHO, you shouldn't give too much more information than they ask for. You learn more from trying and failing (a.k.a. experience) than someone telling you as a by-the-way comment.
"We make a living by what we get, we make a life by what we give." --Winston Churchill