winforms

Test Application Guide for Winforms

I'm a c# developer in a medium/small company. I use to do quick test of the apps that my workmates made and they use to test my applications. We test each form based in our experience. (yes, I know this is not a very formal method) Now a new guy without experience are going to join our team. We think now is the momento to make a little ...

DataGridView Check Box selection

I added datagridview to my win forms app and I also added one Check Box for marking rows. The CheckBox works as I expected until the user sorts the DataGridView. After the sort the previous selection of checkbox column is lost. Is there a way I can make my datagridview remember which row is selected after sorting? ...

Keyword Implementation in C#

Hi All Is there a way, and how would I go about implementing my own keyword such as in, and as (etc), to be used in my code? Here is what I had in mind. I want to (just for my own personal reasons, I guess) add a few keywords of my own, one of which would be the "was" keyword: if(Control was Clicked) { // etc etc } ...

How to make a data-bound combo box display (like a DisplayMember) a concatenated string?

I have a first name and a surname as separate columns in a table. If I bind a combo box to a query and set DisplayMember property to "Name" then each person a table is represented in a combo box by its name. How do I show each person's full name (built from concatenating 2 columns) in a single comb box item in this case? ...

Is it possible to autosize WebBrowser control?

I need to display some portion of html in my windows forms application. It's necessary that this html will be displayed without any scrollbars. I tried to use WebBrowser control for my task, but it lacks of AutoSize property. Is it possible to determine minimal height necessary to display all contents without scrolling somehow? ...

doublebuffering not reducing the flicker

I am drawing an grid-work of objects in a Panel. when I scroll the the panel quickly I get a flicker. I thought that enabling the double buffering may take care of this but what I find is that it does not completely draw everything and I am left with blank sections. could anyone give me suggestions as to what may be happening and how I m...

How do I fix "error 1004, 0, Unable to find property" in an Entity Framework 4 WinForms application?

I've designed an EF4 model (quite complex inheritance, lots of small tables incl. multiple self-referencing), generated (table-per-type) a database and inserted some basic data manually. It works fine in an ASP.Net Dynamic Data Entities web application with full automatic scaffolding. But when in a WinForms application using the same m...

Using a WinForm as a Windows Installer Custom Action

Hello - I am working on in installer project that needs to gather some info and act on it during the install (mainly online key retreival and registration). The Setup Project UserInterface templates seem inflexible and poorly documented so I am looking at opening a WinForm as a Custom Action. I know this is possible because I see refere...

Do not want Form to display over other application windows

I am displaying a new Form from one process by passing the Show method the handle of a Form created in another process. I only want this new Form to display above the passed Form, like a MessageBox. However, this newly launched Form appears above other application windows, despite: Setting Process.WindowStyle.Hidden to the Form-disp...

Multithreaded Applications

Hi All I have been reading the articles on MSDN, but my mind is dead (this usually happens when I read MSDN (No offense MSDN, but your articles confuse me at times.)), and I'm trying to do some "background work" in my app, but not sure how. It's just a single method. But the application hangs, and I have to wait up to 1 - 3 minutes for ...

Making an Extension Method Asynchronous

Is there some way I can make an Extension Method asynchronous? I have looked around for a while now, but haven't yet found anything related. Will keep looking though... ...

MailMessage Question/Confusion

Using this: MailMessage mm = new MailMessage(); What is the difference between: mm.Sender = sender; and mm.From = from; ? Thank you ...

Using Custom Cursor WinForms

Is there a way to use a custom cursor in winforms? There seems to be no option. But when I try to manually add a cursor as a resource, then call it from code, it says that it cannot convert from type byte[] to Cursor. ...

Hide TabControl buttons to manage stacked Panel controls

I need to handle multiple panels, containing variuous data masks. Each panel shall be visible using a TreeView control. At this time, I handle the panels visibility manually, by making the selected one visible and bring it on top. Actually this is not much confortable, especially in the UI designer, since when I add a brand new panel I...

C# detect when form becomes unfocused?

Is there a winforms event that fires when the user switches from a form to another window? I.e. Not through minimizing, but just by clicking on another window. How can I detect when the form becomes inactive? Thanks! ...

What is the easiest way to display an editable Dictionary?

I've got a Dictionary<string, string> and would like to have the user to see and edit the content, possibly adding new entries. How should I do that? Input verification, handling dynamic updates of the source Dictionary and looking nice are a bonus. ...

Is it possible to bind a List to a ListView in WinForms?

I'd like to bind a ListView to a List<string>. I'm using this code: somelistview.DataBindings.Add ("Items", someclass, "SomeList"); I'm getting this exception: Cannot bind to property 'Items' because it is read-only. I don't know how I should bind if the Items property is readonly? ...

Data storage/access for c# windows forms application

Hi All, What is the best or preferred way to store data for a .NET desktop application? I know this coupld depend on how I will be using the app but Im just looking for a simple and easy way to store data for .NET applications. Thanks ...

Quicken like Windows Forms application

Hi All, I need to build a quicken like application, where data needs to be secure. I don't see any database being used by Quicken. I could use XML, MDF or Access database, but data is not secure in the tables. What is the best option? How does Quicken handle it? My application may also have document attachments as well. The functi...

Need Help Setting an Image with Transparent Background to Clipboard

I need help setting a transparent image to the clipboard. I keep getting "handle is invalid". Basically, I need a "second set of eyes" to look over the following code. (The complete working project at ftp://missico.net/ImageVisualizer.zip.) This is an image Debug Visualizer class library, but I made the included project to run as an exe...