I've seen the following code to enable double buffering on a winform:
// Activates double buffering
this.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.OptimizedDoubleBuffer |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint, true);
this.UpdateStyles();
Is this different in any way from simply setting Form.D...
Does a System.Windows.Threading.Dispatcher work on the UI-thread of a WinForms application?
If yes, why? It is coming from WindowsBase.dll which seems to be a WPF component.
If not, how can I invoke work units back onto the UI-thread? I've found Control.BeginInvoke(), but it seems clumsy to create a control only to reference the origin...
What is the proper way to load a ListBox in C# .NET 2.0 Winforms?
I thought I could just bind it to a DataTable. No such luck.
I thought I could bind it with a Dicitonary. No luck.
Do I have to write an class called KeyValuePair, and then use List<KeyValuePair> just to be able to load this thing with objects? Maybe I am missing somet...
I am coding a feature in a program where users can edit documents stored in a database, it saves the document to a temporary folder then uses Process.Start to launch the document into the editing application, let's say Microsoft Word for example.
Then my app needs to wait until they've closed the called process and replace the document ...
Hi
When opening a window, I register a Deleted-event-handler on my business object. It is passed to the constructor as business:
business.Deleted += new EventHandler<EventArgs>(business_Deleted);
Now the user can click a button to delete it (removing the record, you know). The event handler is registered to capture deletion by other ...
I'm writing this question in the spirit of answering your own questions, since I found a solution to the problem, but if anyone has a better solution I would gladly listen to it.
In the application I am currently working on I am subclassing the ListView control to add some functionality of which some interacts with the ListView Selected...
How to get the last selected item in a .Net Forms multiselect ListBox? Apparently if I select an item in the listbox and then select another 10 the selected item is the first one.
I would like to obtain the last element that I selected/deselected.
...
Using C# and the .Net framework 2.0. I have an MDI application and need to handle dragover/dragdrop events. I have a list docked to the left on my application and would like to be able to drag an item from the list and drop it in the MDI client area and have the correct MDI child for the item open. I can't seem to figure out where to att...
I have a form containing a web browser control. This browser control will load some HTML from disk and display it. I want to be able to have a button in the HTML access C# code in my form.
For example, a button in the HTML might call the Close() method on the form.
Target platform: C# and Windows Forms (any version)
...
I would like to be able to create a black custom window (with border and controls) like that shipped as part of expression blend, Twirl, or Adobe Lightroom.
Is there a best practices way of creating an owner drawn window?
Platform: C# and WindowsForms (any version)
...
I've just learned what ASP.NET MVC is and I'm wondering if the pattern is ever used in Windows Desktop application development?
I'm specifically looking at potentially trying to use it in a Desktop .NET application.
Please forgive me if this question is way out in left field in terms of how MVC is suppose to be used. I'm still tryin...
in WinForms I can use Control.Scale to scale control larger. when I do that, all child controls are repositioned and scaled correctly, but font size remains the same.
is there an easy way to force font to scale up/down as well? or is the only way for me to manually update font for all controls when control is being scaled?
background: ...
I have a ContextMenuStrip that contains a submenu of dynamically generated ToolStripMenuItems. There are up to 80 sub menu items. Pressing the first letter of a desired menu item selects it correctly, but if the item happens to be out of the visible range (in a range handled by the scroll arrows), it isn't displayed - the user has to p...
I've recently asked a question on StackoverFlow about the MVC: Can the MVC Design Pattern / Architectural pattern be used in Desktop Application Development?
Based on the answer provided I started research on how this would be implemented in a Windows form Application. I came upon the following CodeProject article: http://www.codeprojec...
Hi,
I met strange issue during designing winform. I placed a few controls inside toolstripcontainer and now I cannot delete them. It's also impossible to delete whole Toolstripcontainer.
I'm using Visual Studio 2008 SP1 plus some extra patches.
Is it a bug in Visual Studio? Is there any workaround? Or I'm lacking of knowledge of VS?
Best...
I need to make a Control which shows only an outline, and I need to place it over a control that's showing a video. If I make my Control transparent, then the video is obscured, because transparent controls are painted by their parent control and the video isn't painted by the control; it's shown using DirectShow or another library, so ...
After experimenting with screenshots of programmatically sized Outlook Inspectors, I've noticed that resizing is not instant. (TakeScreenshot is done programaticcaly by creating a bitmap from the window's device context, then writing it to disk.
Version A: Resize, Bringtofront, TakeScreenshot
Version B:Resize, Bringtofront, threadslee...
I want to diaplay message boxes that looks good, with the possibillity to use bold/italic text and text with different colors. The standard MessageBox.Show doesn't provide this functionality.
I have been trying to create a message box using the WebBrowser control to display nicely formatted text using HTML-syntax. But I haven't succeede...
So i'm not really sure why this is happening but I'm running through some DataRows where I have the control name, property, and value that I want to set. Everything works fine except when I set the TEXT property of a button. For some reason, the click event is called...
Here's some of the code I've got:
string controlName, value, prope...
Is there any way to set an event handler without doing it manually in the classname.designer.cs file other than double clicking the UI element?
...