winforms

Upgrading a WinForms app to WPF

I have a side project that I wrote a few years ago in WinForms. To better help me learn WPF, I would like to rewrite it in WPF. Ideally, I would like to just modify the current project that I have and rewrite the UI in WPF instead of creating a new project. I'm having some problems doing that. I did the following (using Visual Studio 20...

VS 2008 WinForms with SourceSafe

We are using Visual Studio 2008 to develop a winforms application stored in Visual Source Safe 2005. If one of our team members changes a *.Designer.cs file without changing the form's source file the change doesn't appear during a "Get" operation. However, if in Visual Studio you run a compare on the *.Designer.cs file the differences...

IDisposable Winform

What is the best practice for implementing IDisposable on a Winform? I have a dialog which extends System.Windows.Forms.Form The generated designer.cs already contains an implementation of the virtual Dispose(bool) method My form has a field added manually which implements IDisposable Ideally I would be able to hook into the Dispos(b...

How to create a derived ComboBox with pre-bound datasource that is designer friendly?

I'd like to create a derived control from System.Windows.Forms.ComboBox that is bound to a list of objects that I retrieve from the database. Idea is other developers can just drop this control on their form without having to worry about the datasource, binding, unless they want to. I have tried to extend combobox and then set the Data...

Problem with WinForms control hosted in IE

I've had a WinForms control hosted in IE for quite some time now and it has always worked well (.NET 2.0, IE 7). But recently as we are preparing for a new release my script tags (e.g. <script for=> that register for the controls events no longer seem to work. I've never had a problem with this before and none of the code related to this...

Check if a DataGridView/BindSource have changed data (VB.Net)

I have a WinForms app with a datagridview and a bindingsource. I want the user to confirm changes before I save them to the database. I don't want to pop up the confirmation dialog unless I know the user has made changes. So I need a way to check if changes have been made. Any suggestions? ...

MVC frameworks for .NET desktop applications.

I've been playing a lot with MVC lately in the forms of ASP.NET MVC and Django (MTV actually) and I must say that I love it. Are there any similar frameworks for creating desktop WinForm apps? ...

Why does Windows CE drop key events if you hog the UI thread

Now I appreciate the moral of the story is "don't hog the UI thread" but we tried to KISS by keeping things on the UI thread for as long as possible but I think we've just hit the tipping point and we're going to have to change our design. But anyway..... something I noticed on our device that doesn't happen on desktop: When you hog th...

Show XML file in WinForms app with IE-like coloring and collapsing nodes

I would like to show an XML file in my .NET 2.0 WinForms app just like IE does (where you can collapse the nodes, and everything is nicely colored). Is there a built-in way to do this? ...

Looking for fully managed WeifenLuo(DockPanel Suite) replacement or hints on implementing one

I need a WeifenLuo replacement that'll run on both .NET and Mono, on Windows, Linux and Mac, preferrably licensed under the MIT license. I'd appreciate if the API was similar to WeifenLuo's, but I understand that such may not be available. Also, since I couldn't find anything on Google, I believe this might not exist. In this case, I'd ...

Win Form Calculator: Buttons 0 - 9 Event handler to perform repetitive task

I have a win form UI that looks like a typical calculator. Naturally I do not want to rewrite the same logic for every single numeric button(0-9). I want to be able to know which button was clicked so I can perform calculations based on it's text property. Should I just make a method that accepts the button object as a parameter to promo...

Override Button_click event handler

I am developing a Win Forms application using a MVP pattern. I would like to pass the button clicked tag value to the presenter. Because I want to get the button.tag property I need to sender argument to be of type button. How can I do this with out doing this: private void button0_Click(object sender, EventArgs e) { ...

WinForms Databinding

I've built some business objects, and I've built a "data access layer" that will read, update, delete, etc. Now I want to bind these objects to grids/text boxes/combo's etc in a WinForm's app. I could do the manual method like: txtName.Text = employee.Name; and then on save do something like employee.Name = txtName.Text; But I'd...

Windows Forms application "design"

I'm planning on writing a "medium-size" WinForms application that I'll write in C#, .NET 3.5. I have some "generic design questions" in mind that I was hoping to get addressed here. Exception handling in general. What is the best way to handle exceptions? Use try/catch blocks everywhere? this? Localization. If I'd want to have multiple...

ObservableCollection(Of T) vs BindingList(Of T) ?

Hi, I've developped some data based Winforms Application this last two years and all works fine. This application are built on layers (DataAccess, Business Logic and UI). For the Businness Logic, all my objects inherit from a base class called BaseEntity with the following definition (there are some custom objects and interfaces, combin...

Can I host an ASP.NET application in a CAB WinForms application?

I have a .NET 2.0 WinForms application that was developed using the Composite Application Block and Smart Client Software Factory. I'm considering the development of a module that would contain a browser control that would access the ASP.NET website using credentials established when the user logged into the WinForms client. My goal is...

Adding button into a Listview in WinForms

Is there a way to add a button control to a cell in inside a ListView in a WinForms app? ...

Passing AD authentication credentials to IE browser in C# Windows Form

I have a Sharepoint site and I want to open this site in IE by using C# Windows Application. I successfully open the site in IE but my question is how do I send the UserCredentials to the site. It opens the site in IE with defalut credentials. My defalut credentials are username: systemaccount password=123 but i want to open Sharepoint s...

Run code on UI thread without control object present

Hi, I currently trying to write a component where some parts of it should run on the UI thread (explanation would be to long). So the easiest way would be to pass a control to it, and use InvokeRequired/Invoke on it. But I don't think that it is a good design to pass a control reference to a "data/background"-component, so I'm searching...

C# How can I hide the cursor in a winforms app?

Im developing a touchscreen app and I need to hide the cursor whenever it is within the main Form. Any ideas? ...