|
Have an event and create a new line object when the event is triggered. I say a line object because you really need to create this as an object in its own right. That way, the painting of the line is handled by the line object itself.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Could I please have an example that sort of goes along with the code below?
private bool Triggered = false;<br />
<br />
private void Form1_Paint(object sender, PaintEventArgs e)<br />
{<br />
Graphics A = e.Graphics;<br />
<br />
if (Triggered1 == true)<br />
{<br />
<br />
}<br />
}
- "Achieving all knowledge does not mean achieving all wisdom."
- "Welcome to the end."
|
|
|
|
|
MasterSharp wrote: if (Triggered1 == true)
{
.... paint line
Triggered1 = false;
}
Then in the other event handler you set Triggered1 to true and Invalidate. But this is NOT a "design", it's just showing the mechanics. Anytime I see flags I become suspicious of design flaws.
|
|
|
|
|
Flags?
- "Achieving all knowledge does not mean achieving all wisdom."
- "Welcome to the end."
|
|
|
|
|
The member boolean that you set to draw your line. If you want more than one lines, have a line class, and have a collection of them like List<Line> as a member. Then, your paint event should iterate over this collection and draw the lines. That would be a design.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at
|
|
|
|
|
Hey, thanks, I got it!
- "Achieving all knowledge does not mean achieving all wisdom."
- "Welcome to the end."
|
|
|
|
|
Nice reply! I'm voting it a 5 and I never (well almost never ) do that.
Thanks for having my back on the weekend.
|
|
|
|
|
HI,
i've got an icon that i'm saving as Jpeg
(Beacuse i canot use in a butto for EXMPALE)
i can save it i a format of Jpeg
but then it gets a background Color of black
any IDEAS???
THNKS
Have Fun
Never forget it
|
|
|
|
|
|
Save it to a PNG instead. Trust me - this works, I did it today.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
WOW, Great Man it works Fine
Have Fun
Never forget it
|
|
|
|
|
It works with cursors as well.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Really, i'm going to try
Have Fun
Never forget it
|
|
|
|
|
half-life wrote: Really, i'm going to try
Fun isn't it. There's a trick to the cursor - you've got to convert the cusor into an icon and then save the icon.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I neEd It too, COOL
Have Fun
Never forget it
|
|
|
|
|
HI,
NOW, I'm trying to do this:
<br />
Image newImage = Icon.FromHandle(smallIcon[0]).ToBitmap();<br />
Bitmap bmp = new Bitmap(newImage, sz);<br />
bmp.Save("D:\\XPIcons\\XpLargeIcon" + i.ToString() + ".png",<br />
System.Drawing.Imaging.ImageFormat.Png); <br />
But it gives me an GDI excaption
do u have any IDEA?
Have Fun
Never forget it
|
|
|
|
|
|
Sorry for that - I was off doing the quiz from this thread[^].
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
HI, Nice
Another Q,
Do u know maybe if i can Put an Image in an DataGridButtonCell???
THANKS
Have Fun
Never forget it
|
|
|
|
|
i have new car, how I use? plz send code urgent.
|
|
|
|
|
What can i say.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
Come on Kyle, stick to the Soapbox. There is already enough junk in here with people being serious.
|
|
|
|
|
led mike wrote: There is already enough junk in here with people being serious
Very true.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
PlsSendCode wrote: i have new car, how I use? plz send code urgent.
Ok[^]
But note in the future that Lisp questions are off topic in this forum.
|
|
|
|
|
i didnt understand the advantage of using delegates i want to know some practical aspect why to use delegates?
why we assign a function to a delegate instead of directly calling that function.
Plz provide me saome practical example of delegates so that i can take advantage of delegates
|
|
|
|