winforms

What is the difference between a .h(header file) and a .cpp file?

I am creating a windows:forms application. I have read some of the answers give to try to understand the concept of .h(header file) & .cpp(implementation files). As I created the GUI for my app. I noticed the code being placed in the .h file. But when I double clicked a button control to add code to the procedure, the code was created in...

Winforms treeview, recursively check child nodes problem

The following code is taken direct from Microsoft at http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.aftercheck%28VS.80%29.aspx. // Updates all child tree nodes recursively. private void CheckAllChildNodes(TreeNode treeNode, bool nodeChecked) { foreach (TreeNode node in treeNode.Nodes) { node.Checke...

creating an Info-box like control in .NET 2

Hi, i want to create an info box in .net 2 (attached is an image with an example) I wanted to use a panel, but I cannot change the color of its border. is it possible to change this property? if so, how? Thanks, Shuky ...

OpenFileDialog Control - How Can I Grab the Selected Path and Show it in a Text Box?

Here is my snippet: private void btnBrowseCInv_Click(object sender, EventArgs e) { ofdBrowseVInv.Title = "Locate Customer Invoice File"; ofdBrowseVInv.Filter = "Portable Document Format (*.pdf)|*.pdf|All Files (*.*)|*.*"; ofdBrowseVInv.FileName = ""; ofdBrowseVInv.FilterIndex = 0; ofdBrowseVInv.InitialDirectory = ""; ofdBr...

How do I prevent a popup form from taking focus from the parent

I have a small windows.form that I use to present information when the mouse is over a regions on a windows.Form, however it takes the focus from the parent window when it is set to visible. Is there w way of preventing this - it causes the main form to flicker as it toggles between in focus and out. c#, .net 2.0, system.windows.forms ...

Deleting GDI+ objects

I am building a C# application that uses GDI+ to draw images and shapes to the form but I have no idea how to delete them. Let's say I have a optional grid drawn using GDI+ and when users turns it off, I want to, well, turn it off, delete it somehow and without affecting other objects on the working canvas. What is the best approach? Tha...

Should you name all of your UI controls? What naming scheme do you use?

This can be applied to any language/UI project. When the code is automatically generated, is there a need to name all of the UI controls? Presently I only name the ones I am referencing in code (although admittedly sometimes I get lazy and leave them). Or do you stick with the pre-generated names (textbox1, splitContainer1, menuStrip1, e...

What is the WPF equivalent to ControlPaint.Light?

What is the wpf equivalent to ControlPaint.Light? http://msdn.microsoft.com/en-us/library/3wz9t9fy%28VS.80%29.aspx Given that WinForms uses System.Drawing.Color and wpf uses System.Windows.Media.Color ...

Use NativeWindow to disable screensaver

Hi, I want to disable the screensaver and monitor power off. At this stage there's no windows form, which I could youse. Thus I wan't to use NativeWindow. Here's my code sealed class ObserverWindow : NativeWindow, IDisposable { internal ObserverWindow() { this.CreateHandle(new CreateParams() { Paren...

ComboBox in windows forms Datagridview control

I have a datagridview on a windows form. It has clolumn [EmployeeNumber, EmployeeName and EmployeeDepartment]. I want to be able to edit values directly in the grid but i want EmployeeDepartment to be a combobox column, such that on cell edit, a combobox shows up with available options for the employee department. Has any one been able...

how to change backcolor for disabled ComboBox

how to change backcolor for disabled c# ComboBox for more Readablity ...

c# How to enforce uppercase in a specified colum of a DataGridView?

I would like to be able to set the CharacterCasing of a specified column to uppercase. I can't find a solution anywhere that will convert characters to uppercase as they are typed. Many thanks for any help ...

How do I change the datagridview selected row background color?

How do I change the datagridview selected row background color in C# windows applications? ...

How do appDomain provide Isolation.

In my window forms application, I create a Appdomain say sandBox. In this sandbox i excute some code Say TestMethod from TestAppdomain Class. This class is in Test.dll which is not loaded in the current appdomain (Default appdomain). Now while executing TestMethod some exception occurs, then I want the sandbox domain to be unloaded and ...

Is Arial Unicode MS right font for WinForms UI?

We have .NET WinForms based application and it is expected to work on at least 9 languages including English Spanish Russian Simplified Chinese Traditional Chinese Korean Japanese Our application shall work on Windows XP (SP3), Vista, Windows 7 and Windows 2003 & 2008 operation systems. We have never used Arial Unicode MS for local...

How to fix DataGridView RowHeader text wrapping problem?

I am trying to decrease the height of DataGridView rows to allow showing as much of theme. But all my best effort produces the following result: These are the settings used for the RowHeaderDefaultCellStyle: aGrid.RowHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight aGrid.RowHeadersDefaultCellStyle.BackColo...

Use a custom usercontrol in a Janus GridEx

Hello, I'm search for a method to add a custom usercontrol in a Janus GridEx with C#. In the designer I have different columntypes (link, text, image, ...) but I need something with more functionality (multiple checkboxes which must be set/saved in a seperate table). I think this would be easiest if I could just add a custom component ...

Where Can I Find FileUpload Class for Windows Application?

I have this snippet: protected void ProcessUpload(FileUpload upload) { if (upload.HasFile) { string fileName = Path.Combine(Server.MapPath("~/Uploads"), upload.FileName); if (File.Exists(fileName)) File.Delete(fileName); upload.S...

how to: make a panel resize with its form; and attach a console for output

Hi, guys how to make the Panel widget change it's size on Form1_SizeChanged how to attach a console window in order to see console.writeline messages ...

How to get a Windows Forms panel as a bitmap with C#?

I have a Windows form with a panel with several controls on it. The panel does not take up all of the form space, but only a small part. What I want to know is if there is some way to retrieve the display of the panel (with all child controls) as a bitmap. Like a screenshot but only cropped to the panel. I am not looking into the screen...