winforms

Where to put Application scope components in Winforms?

Where do you store application scoped components in your winforms apps? I see that I can create a descendant of Component in my application. I could then drag and drop the components that I want to share among the forms in my project. Is this the best practice for shared access to components (non-visual controls)? In Delphi, we had a Dat...

considerations for saving data to ONE file or MULTIPLE?

i am going to be saving data with DPAPI encryption. i am not sure whether i should just have one big file with all the data or should i break up the data into separate files, where every file is its own record. i suspect the entire dataset would be less than 10mb, so i am not sure whether it's worth it to break it down into about a few h...

Where is the code behind Add button for Winform BindingNavigator Control ?

There is code for save button, but I can't see any code behind the Add button though the button works ? So what would it be as I want to create my own not from scratch ? Thanks. ...

opening and saving file without save/open dialogue

i would like to do FILE I/O without a dialogue. the file always be the same and the location will always be the same, therefore i dont need a dialogue. i would like to know how can i do this? what is the code to open, write, and save to a file without the dialogue. ...

Is it possible to skin Winform DataGridView on XP to look like on Vista

It is possible to change the color of DataGridView Headers (http://stackoverflow.com/questions/1247800/how-to-change-the-color-of-winform-datagridview-header) but still it doesn't seem enough to look like Vista. So is it possible ? ...

what is the difference between DPAPI and file.encrypt

what is the difference between DPAPI and file.encrypt (I/O)?? ...

How does a user control pass focus to a control on the parent form?

I'm working on a user control that will accept and validate an address. The addresses are all within a specific domain (in particular, Australia). In the address user control I've got three fields: suburb, state and postcode (aka zip code). When the user types part of a suburb name and hits TAB and moves into the state field, I query t...

Avoid attaching event again

Hi, the situation is like this i have a control and it has event Render in the definition of the control, to this event is attached handler i am looking for a way to show some kind of message if in some class that uses this control another handler is attached to this event Best Regards, Iordan ...

How do I detect whether a graphic will be dithered?

Our application draws drop shadows beneath thumbnails. It does this by creating a bitmap, getting a Graphics object using Graphics.FromImage, and then overlaying images using Graphics.DrawImage. I'm using it today for the first time over remote desktop, and it looks awful, because the shadows are being dithered. I don't know whether t...

Detecting Ethernet Port insertion/removal in my winforms application?

Hi, I would like to detect when a device is connected to an ethernet port of the machine that my application is running on. I know how to do this with a USB port but the problem is, the Port isn't USB! If it was a USB device I would simply override WndProc and catch the message, if it is WM_DEVICECHANGE, then i'm on to a winner, I was ...

Handling resources for large number of duplicate icons

I am using a TreeView with an ImageList. As the TreeView is filled with items, each item will have an icon associated with it. Many of these icons could be identical, but currently, I am not adding any code to track duplicates, I simply add each icon to the ImageList and then track the icon associated with each TreeNode. My question is ...

Form.Location doesn't work

I asked this question previously and thought I had it figured out but it still doesn't work. http://stackoverflow.com/questions/1214014/form-show-moves-form-position-slightly So I have a parent form that opens a bunch of children with show() and then when one is needed I use bringToFront() to display it. The problem is when show() is ca...

Reset RTF in RichTextBox?

I'm trying to "reset" the formatting in my RichTextBox (WinForms, not WPF). I was previously using richTextBox.Text = richTextBox.Text; However, that seems to have suddenly failed me. Now no matter what I set richTextBox.Text to, it retains some of the rtf formatting. I've tried richTextBox.Rtf = richTextBox.Text; However, that...

What are the Finalizer Queue and Control+ThreadMethodEntry?

I have a WindowsForms app that appears to leak memory, so I used Redgate's ANTS Memory Profiler to look at the objects I suspect and find that they are only held by objects already on the Finalizer Queue. Great, exactly what is a the Finalizer Queue? Can you point me to the best definition? Can you share any anecdotal advice? Also, all ...

How to easily duplicate a Windows Form in Visual Studio?

How can I easily duplicate a C#/VB Form in Visual Studio? If I copy & paste in the Solution Explorer, it uses the same class internally and gets messed up. How do you do it? ...

How to: debug an ASP.NET Web-Service when called from a win-application

I have a windows forms applications that accesses a web service. I want to debug the web service so that when I call its methods from the win-app it should stop on the breakpoints within the methods. ...

Steps for embedding a windows forms user control in web page

I am developing a windows forms user control in Visual Studio 2005. It is a file upload control and uses only 2 elements. A button for showing opnefiledialog An openfiledialog I have added an object tag to the html page with the class id and all that. <OBJECT id="myControl1" name="myControl1" classid="ActiveXUploadFile.dll#ActiveXU...

Turning off screen echo in VB.NET

In Microsoft Access there was an easy method to turn off screen updates by setting Echo = False. Is there an equivalent in VB.NET for WinForms? I've got a situation where I'm trying to prevent users from seeing controls flickering while they're being updated. I could probably solve the problem by coding it differently, but would rather a...

Creating HotSpots in C#

... Is it possible to create hot-spots in C# so that when the mouse is over a certain area an event gets triggered? Thank you :o) ...

Unable to use Client Application Services with custom MembershipProvider.

Hi, I have a Windows-Forms Application that I configured to use with an ASP.NET Service that is an Authentication service using a custom MembershipProvider. When I call Membership.CreateUser in the Windows Application a NotSupportedException is thrown telling: "Specified method is not supported.". I tried creating a web page in the we...