Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I know this question is short but there is nothing to say.
I found a nice html effect:
https://codepen.io/jkiss/pen/OVEeqK
Links to codepen.io must be accompanied by code
Can someone implement this in a borderless maximized winforms application?
Im not very good at programming in this kind. I hope somebody can help me.
(I made the assumption you wanted to write C# code instead of the HTML/css/js, and not host HTML in a WinForms application. Let me know if I was wrong)
Even though I think this question is way too broad for SO, here are some starting points:
in WinForms you can paint on a form by overriding its OnPaint method
if you clear the entire screen each frame in OnPaint, you should override OnPaintBackground and leave it empty
call SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true) in the constructor of the form to avoid flicker
the Graphics object that is provided for you in the OnPaint method can be used to draw lines and fill ellipses
to keep your application responsive while having a decent framerate, you can call Invalidate() in your OnPaint method. This is faster than using a timer (although you won't get a constant framerate).
If you run into specific questions, SO is definitely the right place to go.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
i want to know how to fit c# application in every Resolution my c# application open in my computer is perfect but when i install this application on my client machine so it's show half application.
What I have tried:
this.WindowState = FormWindowState.Maximized;
this.Location = new Point(0, 0);
this.Size = Screen.PrimaryScreen.WorkingArea.Size;
This won't work for all, you need to desing your application responsive. You need to use panels, groupboxes and objects like these and you need to anchor these objects inside your form, then you need to get user screen resolution and set it for your application.
Summary: this code may works but not not perfect for all resolution. You absoluty need anchoring objects. Desktop application sometimes have good pain with this matter.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
i have created an application using C# that has some forms with a lot of pictures and text. The problem is that the background image seems to be affecting the performance. it looks like processing or rendering to load the form and its noticeable even at a run time.
i already tried changing the background image but still it has that rendering look. i tried removing the entire background image and it runs smoothly without it.
i captured my screen here's a Link
As per #Taw,
This link explains form double buffering for your C# application.
It allows you to write to an off-screen buffer to prevent flickering and other graphical corruption from occuring while writing directly to a form. It is a very common technique in game and graphics development to allow very complex images to be created while prevent tearing, shearing, and other fun side effects that you can check out when you get a chance.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Somebody know how to add a button on top right corner of any windows app loaded?, and manage a controller to interacting with them.
Really what I want is a method to set the property "Always on top" of any form.
I appreciate any help to do this posible... :)
(my programing language is c#)
It is possible to do so but prepare yourself to get dirty. Really dirty.
See this CodeProject article: Add Your Control On Top Another Application. Basically that guy is drawing a kind of custom control into another app's title bar.
In addition to this, this article about global system hooks might get handy for you as well.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'll simplify the situation to get rid of confusion.
I want to make a program that only has 1 button in the program. Upon clicking the button, the program will simulate a generic gamepad button. I'm sure when the program starts, it will have to somehow emulate a gamepad. The gamepad that is being emulated should be visible in the Control Panel. (joy.cpl to be more specific)
I have to do this without making a driver or relying on a 3rd party library/API- I know it can be done this way since I've seen some programs that actually do this already but my program will have a completely different use than those. I cannot find any good information on where to start, so pushing me in the right direction would be nice or showing me some code in C# would be cool, too!
Thanks, guys!
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I have created a simple paint application in VC# 2008 with the help of a YouTube video. Its code is as here:
http://paste.pocoo.org/show/268704/
The problem with the code is that if I draw something in the picturebox, minimize the application, and thn maximize it, whatever I had drawn, disappears. The picturebox becomes clear. Why is it so? Plz help me.
You should be doing your painting during the Paint event. This event completely redraws the image. So when you un-minimize the application, the image is redrawn and you don't do anything.
Your application needs to store information about what has been drawn so that it can be redrawn. This is an example of the Model-View-Controller model. The PictureBox is the viewer, the stored information is the model and mouse event listeners will be part of the controller that can make alterations to the model.