winforms

Can i use Paint.NET API to embedd it in Winforms application?

I'm trying to let the use crop a selected area from picture in my winforms application and thought to embed the Paint.NET and limit its functions. I understand that Paint.NET API is unavailable.. I'll be happy to get recommendation for another tool i can use to crop images in Winforms application. Thanx. ...

Looping through WPF ListView DateTemplate Items

I have a ListView in a Windows Form that I bind a list of objects to on the creation of the form. What I would like to do is on a button click loop through the items that were created and change their IsEnabled property to false. I've tried two methods and neither were particularly successful. Can anyone help fix these up and/or sugge...

c# winapp add app.config to installer?

Okay I've got my app.config file that is containing my database settings. All works well on my development machine. But when I install it on a test machine I'm getting a null reference on the following line: ConnectionString = ConfigurationManager.ConnectionStrings["MyDBConn"].ToString(); Why is this happening? I guess that the app.c...

listview columnclick outside columns

ListView.ColumnClick doesn't seem to fire for clicks in the header area that is outside the columns (area to the right of the last column, if there is any) is there some easy way to detect clicks here? ...

progressBar while MainFrom initialize

Hi guys, I have a windows form application that needs to load a bunch of things before loading the Main window. I thought this would justify a progressbar, so I thought I display another form that contains the progressbar control using the constructor of my main form. It all works fine but if I try to put text in a label on the intro f...

Prevent form from freezing

I'd like to download a picture and afterwards show it in a picturebox. at first I did like this: WebClient client = new WebClient(); client.DownloadFile(url, localFile); pictureBox2.Picture = localFile; But that wasn't perfect because for the time while the download is performed the app is kinda freezing. Then I changed to this: pu...

What is the difference between User Control, Custom Control and Component?

These are three different things you can add to a project and I am not quite sure if I understand the difference. They all seem to for example show up in the component toolbox when working with a Form. What are some common usage scenarios for each of them? What is the difference? ...

C#: How to bind the text of a winforms button to a resource

We have a resource file with lots of translated strings used various places in our application. Is there a better way for binding for example the text of a button to a certain string? Currently we are usually just doing something like this in the constructor, in a Load event handler or in a method called by one of those: someButton.Tex...

Tooltips won't show second time form is created.

I have a dialog box with controls that is popped up and when a control is moused over the controls a tooltip is displayed. However, if I close the box then re-display it no tooltips will work. Here is a portion of my code. I am initializing tooltipOn when the form is loaded to null. I have done a trace and tooltip1.Show() does get called...

Easily Creating Dynamic Form/Controls Within Qt

We've got a Qt application that configures external devices by querying their configure interface and then, using a QWebView, we present an HTML page with the appropriate controls. We'd prefer to hand the configuration information to some sort of Qt "Form Builder" class, and have it spit out a QWidget with a layout that contains native ...

How do I tell which tab you are moving from/to in a .NET tab control?

I need to determine which tab the user is coming from, and going to, when they switch tabs, and possibly cancel the switch. I have tried the Deselecting, Deselected, Selecting, Selected events, and all of them show the e.TabPageIndex to be the same as the sender.SelectedIndex. Is there an event, or property, that I can use so that I ca...

Visual C# error when changing anchor for multiple controls

Visual C# 2008 is giving an error when I attempt to change the anchor for multiple controls simultaneously. This error does not occur when done individually. Property value is not valid. Could not find file 'C:\Users\user\Documents\Visual Studio 2008\Projects\test\test\Resources\WelcomeBorder.png'. The image was previou...

WinForms: automating common chores

When adding a control to my form, currently I have to wire it up with my save and load code, with my internal data structures and I have to do this with all my controls. This scenario severely violates the DRY (don't repeat yourself) principle and can introduce subtle bugs. I have came up with the idea of traversing all the Controls in ...

What is the best reference material on WPF custom controls

I currently do all development work in VB.NET 2008, winforms; but within 18 months will be switching to WPF (for better or worse). I have had great success using Matthew MacDonald's "Pro .NET 2.0 Windows Forms and Custom Controls in VB 2005" book. This is an excellent reference focused entirely on the development of custom controls in ...

WinForms: NumericUpDown (.NET CF 3.5) and real numbers

NumericUpDown seems to be only dealing with integers. How can I modify it (?), so I can use doubles as Value and Increment? ...

displaying a pdf on a windows form?

in vb.net is it possible to display a pdf file on a form? ...

Architecture for WinForms applications?

I have started a WinForms project a few weeks ago and as I did not really know what features I wanted, I just added them along the way. This now caused a horrible mess where my MainForm is a big ball of mud and where for example some important state changes are triggered by UI elements to the point I have to call the OnChange Event of a ...

how do i get microsoftreportviewer on my winform?

i am trying to put a pdf file on my form using microsoft report viewer, but i cannot find it. where is it? ...

difference between microsoft report viewer and adobe pdf reader tools?

i would like to display a pdf on my winform and am thinking of using of those tools in my vb.net application. does anyone know the difference between the two? ...

In Windows Forms, how to stop the the UI thread from blocking when the user clicks a scrollbar?

No other control does this other than the scrollbars of panels, etc. Clicking and holding a button, a label, a link, a tab, whatever other control does not have this effect. But as soon as a user clicks the scrollbar, or clicks and drags the scrollbar, all other processing on the UI thread is halted. This is something that is a big pr...