winforms

Correct way to Handle Exceptions in UserControl

Hi all, I'm build an UserControl and I'm not sure how to handle exceptions, the Control itself is not very complicated, the User chose an image from disk so they can authorize it, I don't know exactly how the control will be used so if I use a MessageBox I might block the application, and if I just re-throw it I might crash it. thanks i...

WinForms: Best way to suspend control events?

This seems like a very simple and a very common problem. The simplest example I can think of is this. The form has 5 checkboxes with a "check all/check none" checkbox above them. When a user selects the check all checkbox I toggle the states of the "children" - obviously I don't want to fire the check events of all the children until I a...

Better TreeView for Windows Forms - .NET 3.5

Is there a better free TreeView control that exists for Visual Studio 2008 / .NET 3.5? I believe I need something a little more powerful than the out-of-the box version. I'm not exactly sure for what yet but I thought I'd ask quickly before I get too far in to my project... Thank you! Best Regards, Frank ...

What is causing ObjectDisposedException from SerialPort while debugging .NET winform?

Vista SP1 Visual Studio 2008 SP1 .NET 3.5 SP1 C# I have a winforms app I'm playing with that uses a SerialPort object as a private variable. When the application is compiled and executed, it works great. It also works running in debug mode wihtout any breakpoints. 90% of the time when I stop at a breakpoint and try to step through code ...

Cannot tab out of databound Winforms dropdown list

This is a bit of a strange one, but I've been struggling for a few hours now and I can't understand what is happening. I was wondering if anyone else has experienced this problem, and can perhaps explain it. I'm building a simple Winforms app and trying to use many of the built in controls. Basically, I've got a form with a user contr...

Windows Forms Error: "A strongly-named assembly is required"

I have a Windows forms project (VS 2005, .net 2.0). The solution has references to 9 projects. Everything works and compiles fine on one of my computers. When I move it to a second computer, 8 out of the 9 project compile with no problem. When I try to compile the 9th project (the main project for the application - produces the .exe file...

Multilingual Winforms in .Net - opinions and suggestions

So I've got a program that needs to be multilingual. The only difference between what I'm needing and what I've found on the web is that all the computers my program will run on are set to the localization of EN. We have spanish speaking employees that will use the program just like the english speaking employees. So I won't be able to ...

DatagridView Not Displaying the error icon or error text?

I have a win form (c#) with a datagridview. I set the grid's datasource to a datatable. The user wants to check if some data in the datatable exists in another source, so we loop through the table comparing rows to the other source and set the rowerror on the datatable to a short message. The datagridview is not showing these errors. ...

Add custom design time command to WinForms control

I have a custom WinForms control (inherits from control, i.e. without user interface jsut as Timer) to which I want to add a custom command add design time. This could be similar to the "right click and choose 'Edit Items...'" of a menu. Is this posisble? How? Also, could you recommend some general reading (online) about improving th...

where does the model go?

I have a VS solution, with the following projects. -GUI -DataAccess -BusinessLogic -BusinessObjects but where should the main model class reside? This is usually a cache of a set of objects which are the results from the data access layer and the GUI using virtual grids to view data inside the model. The question would be the same ...

Most number of projects within a solution

for VS 2005 is there a max number of projects that will cause performance issues. We have now up to 25 projects and growing. Should we making these binary referenced or are we breaking out our application logic into too many different projects. Seems to start to be a big performance issue lately. ...

where would report generation code go . .

I have a visual studio solution with the following projects: UI DataAccess BusiessLogic BusinessObjects I now have a bunch of code that generates reports that are sent out via email or saved as csv files. These ReportGenerators classes take in business objects and output either files or strings. which project would you put them in?...

Input handling in WinForm

What is the best way to block certain input keys from being used in a TextBox with out blocking special keystrokes such as Ctrl-V/Ctrl-C? For example, only allowing the user to enter a subset of characters or numerics such as A or B or C and nothing else. ...

Form.Show not showing up in Taskbar in Vista

I have a winform app that is hiding it's UI and waiting on a named pipe message before showing up On receiving the event the thread invokes into the main UI thread and then does the following Set the opacity to 100 ShowInTaskbar = true; BringToFront(); ON Windows Vista the window does not show up on the taskbar though and the window i...

LIghtweight instrumentation

I have a winforms app and i want to keep track of every time a user clicks certain buttons, etc as well as other actions. What is the best way for me to keep track of this information and then put it together so i can run metrics on most used features, etc. This is a winforms app and I have users around the world. ...

How do I tell if my application is running in an RDP session

I have a .net winforms app which has a few animation effects, fade ins and scroll animations etc. These work fine however if I'm in a Remote Desktop Protocol session the animations start to grate. Can someone suggest a way of determining whether or not an app is running across an RDP session so I can turn the effects off in this case? ...

What resources, outside of the Microsoft site(s), are available for learning about Form and MVC web applications?

I've found a few pages (some that even link to a number of other pages) on the Microsoft website that I bookmarked last night for reading today, but I'm curious as to other good non-Microsoft resources for discussing ASP.NET web applications, both Forms and MVC (including comparisons/contrasts between the two). ...

Get Path to Execution Directory of Windows Forms Application

I would like to get the path to the execution directory of a windows forms application (ie: the directory in which the executable is located). Does anyone know of a built-in method in .Net to do this? ...

DataGridview Column Resize Problem

I have a datagridview where the users can select which subset of columns to view. The problem I am having is that when I change the columns being displayed, the column widths are only being determined by the width of the Header Cells, not the data in it. I do have each column set to AutoSizeMode = AllCells. If a new row is added, the c...

What would be the expected behavior for a window that hides itself upon keystroke

This is a subjective question, but I need opinions. I have a WinForms C# application whose window hides itself after a specific keystroke (Enter or Escape), with possible modifiers (e.g. Ctrl-Enter). When hiding on KeyDown or KeyPress, the other application that becomes active after my window hides itself receives the KeyUp event for th...