Jump to content
  • Advertisement
Sign in to follow this  
Muzzy A

C# stop waiting on events

This topic is 2233 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im using C# to start on a Particle Editor for school, but I forgot how to stop waiting on events.

I know you at least need to do this, which i've done, but i can't remember what else I was supposed to do somewhere else. Anyone else know?

// Inherit from Panel
class graphics_panel : Panel
{
public graphics_panel()
{
DoubleBuffered = true;
}
}
Edited by Muzzy A

Share this post


Link to post
Share on other sites
Advertisement

Im using C# to start on a Particle Editor for school, but I forgot how to stop waiting on events.

I know you at least need to do this, which i've done, but i can't remember what else I was supposed to do somewhere else. Anyone else know?

// Inherit from Panel
class graphics_panel : Panel
{
public graphics_panel()
{
DoubleBuffered = true;
}
}


Check the value of DoubleBuffered, and if it's true, start the relevant code, is what comes to mind.

Share this post


Link to post
Share on other sites
well by default c# waits on an event to happen like "GetMessage()" in Windows. I want it to run like "PeekMessage". I just don't remember where to change that, i know it wasn't that buffer check though. Thanks anyways =)

Share this post


Link to post
Share on other sites

well by default c# waits on an event to happen like "GetMessage()" in Windows. I want it to run like "PeekMessage". I just don't remember where to change that, i know it wasn't that buffer check though. Thanks anyways =)

Ah - You're probably looking for an EventHandler, then.

Share this post


Link to post
Share on other sites
There are several ways to do what you want. In order to not wait for messages at all, you must change Application.Run(new YourForm()); in Program.cs (default location of that line). An easier solution would be to just add a timer and call Refresh() or yourPanel.Refresh() on its Tick event.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!