winforms

User cannot Install Click once application

I have a relatively simple support application which I have chosen to deploy to our support staff via click once. I assume it's still called Click-Once. I'm using the publish tab of the project's properties in VS2008. Several users have managed to click through to the url, download and run the application. One specific user cannot. H...

Grid with moving items

How can I do a Grid Control in which I can move the items (the content) inside by mouse drag & drop? For instance move something from A1 to B4, like in Excel. I'm using C#, NET 3.5, and Winforms. ...

tabcontrol background image in winforms

Hi I want to put background image from tabcontrol in c# winforms. How can i change it? ...

Opening multiple files (OpenFileDialog, C#)

Hi all, i'm trying to open multiple files at once with the OpenFileDialog, using FileNames instead of FileName. But I cannot see any examples anywhere on how to accomplish this, not even on MSDN. As far as I can tell - there's no documentation on it either. Has anybody done this before?? ...

C# Threads - Parent Access Problem

my aim is that in the function "Dummy" i can change the controls like labels etc of the form from which the thread is initiating..how to do it..please don't suggest completely different strategies or making a worker class etc...modify this if you can Thread pt= new Thread(new ParameterizedThreadStart(Dummy2)); private...

How to make Taskbar Flash on Lost Focus

I stumbled on this code below and tried to implement it in my WinForm App to help my users as many are very NOT tech-savy. Unfortunately, it does nothing. It does not generate any errors or anything. It just doesn't make it Flash. Can anyone offer any insight? I have tried it on Win 7(x64) & Win XP (x86) with the same results on ...

Application.Exit() vs Application.ExitThread() vs Environment.Exit()

I am trying to figure out which I should be using. On closing my WinForm App fires of a Form in Dialog mode. That form runs a Background worker that Syncs the DB with the remote DB and displays it's progress on the "Splash Form." I have a method like so --> private void CloseMyApp() { SaveUserSettings(); ...

Using the Exited event in vb.net

Ok, I'm making a very basic vb.net winforms app, essentially you can drag files into it, and it then uses a batch file to process the files. It's pretty simple and everything is going to plan so far, it accepts the right files, it uses the batch file to process them and the batch file does what it is supposed to. The only problem is th...

Why is .CausesValidation set to True by Default for Buttons?

When creating an instance of a button within a .NET WinForms application, the .CausesValidation property is set to True. Why would all buttons be assumed to raise validation events? Doesn't this mean that, by default, all controls on a form with _Validating events will have that event called whenever the button simply gains focus? I...

How should you diagnose the error SEHException - External component has thrown an exception.

Whenever a user reports an error such as 'System.Runtime.InteropServices.SEHException - External component has thrown an exception.' - is there anything that I as a programmer can do to determine the cause. Scenario : One user (using a program my company wrote) has reported this error. This may or may not have been a one off error. Th...

How do I cancel a WinForms TreeView ExpandAll?

I have a winforms TreeView control that allows you to browse an object hierarchy. Incidentally, there are some circular references between objects. I have no problem letting the user navigate circular references, but I want to prevent a '*' keypress or ExpandAll() command from executing. How do you go about doing this? ...

using a win form combo box Items.AddRange method

I have an array of objects that I'm trying to add to the Items collection of a combo box control using the AddRange method. The method takes an object[] but when I pass it the name of the array which has been intialized with some values, it complains: The best overloaded method match for 'System.Windows.Forms.ComboBox.ObjectCollection....

Implementing INotifyPropertyChanged - does a better way exist?

Microsoft should have implemented something snappy for INotifyPropertyChanged, like in the automatic properties, just specify {get;set;notify;} I think it makes a lot of sense to do it. Or are there any complications to do it? Can we ourselves implement something like 'notify' in our properties. Is there a graceful solution for impleme...

C# How to show a icon when multiple window forms are minimised on the taskbar

Hi All I hope someone can help as I have been pulling my hair out trying to figure this out. I have an application with multiple forms, each form has the same icon, so when I minimise that form the form appears on the taskbar with the specified icon. However, when I have multiple form windows minimised onto the taskbar the the forms a...

Automated Unit testing - why? what? which?

I am a C# winforms developer with an experience of around a year. The only unit testing that I have been doing till now has been manual. I have thinking about following for sometime: Why do we need to have automated unit testing? How effective is it? If I want to start doing automated unit testing. Where should I start from? (have hea...

c# forms application displaying even if user loggs off or locks computer

I'm writing an application that'll display a lightweight dashboard to the computer's secondary display (displaying permits that'll expire within X days and suchlike). It will be running on a secretary's Windows XP computer with 2 graphics cards. One for the secretary's monitor and another for the flatscreen that's facing the reception a...

How to disable navigation on WinForm with arrows in C#?

Hello, I need to disable changing focus with arrows on form. Is there an easy way how to do it? Thank you ...

How do I use a shape to define a clipping region?

I am still simulating a radar (or attempting to) and through trial and error managed to draw a pie on top of my picturebox's background the more or less covers the target area I wish to draw to. Now I'm trying to make that area my clipping region. How do I achieve this? I haven't come across anything that explains this clearly. I have th...

Text in Title Bar

How can we move text in the Title Bar of a form in C#.net using VS 2008? ...

Design: Accessing child collections whilst avoiding the parents!

Note: WinForms C# Early Learning Level! I would like some assistance with the best way to implement a situation in a C# object environment. I cannot post code because it doesn't exist yet, however I can give you an alternative real-life comparison. In simple terms (because thats how I work) I have a Book class. I have a collection (<L...