winforms

Tooltip in .Net

Hi, I have a DataGridView in a Winforms application containing a collection of items. Each item has an image and various other details. I know it is possible in WPF, but can you get a tooltip to display an image and a more structured set of details then just plain text? Thanks. ...

How to stop DataGridView from polluting my Designer file with column controls?

I'm sure you know the problem, as soon as a BindingSource is connected to a DataGridView the DataGridView generates columns for each Property found in the Type of the BindingSource's DataSource and adds that crap to the Form.Designer.cs file. We only use run time generated columns, the clutter in the designer file is just waste of code,...

Javascript Like Modal Window for WinForms.

Does anybody know a good Modal Window control sort of like the ones used in Javascript but available for WinForms (C#) with the transparent background and all. Example in Javascript http://okonet.ru/projects/modalbox/ Something like ModalCoolForm f = new ModalCoolForm(); f.ShowDialog(this); ...

use class in another windows form c# ???

I have a problem in a same namespace: public partial class frmForm1 : Form // Form1 { public class Account { public string Username, Password, RePassword, Name, bd, dt, dc; } public class ListAcc { public static int count = 0; private static List<Account> UserList; ...

Application doesn't exit with 0 threads

We have a WinForms desktop application, which is heavily multithreaded. 3 threads run with Application.Run and a bunch of other background worker threads. Getting all the threads to shut down properly was kind of tricky, but I thought I finally got it right. But when we actually deployed the application, users started experiencing the...

How should I display a notification bar in WinForms?

You all know the "You've got new answers!" notification bar on SO. I'd like the same thing in a Form, preferably just as smooth. Is there a simple way? Or do I have to completely create this myself? My searches did not yield any good results, only lots of progress bars and popups in the system notification area, but that's not what I'm ...

Write status messages to a textbox asynchronously?

Hi there, I recently started programming in WinForms using C#. I have a requirement where I need to search a set of folders and the sub-folders and display the status information to a textbox as I do the search like - Looking up folder "C:\Windows"... Found 8 files... Copying file 1 of 8 to "D:\Temp"... I have a method which does all...

Component Application Block for .NET 2.0 (WinForms) - What are the new versions?

What are the new versions of CAB, mainly for WPF? What is changed? Is it the same stuff, adjusted for WPF characteristics? Does it still rely on Unity (and SCSF for the matter)? I find Microsoft and MSDN to be very confusing sometimes ... :( ...

C# WinForm Drawing - how to clear and redraw

Here is screen shot of my game. On the left is my problem, seem "old draw" still existing. On the right is what it should be. http://img682.imageshack.us/img682/1058/38995989.jpg drawing code Graphics g = e.Graphics; for (int i = 1; i < 27; i += 1) { for (int j = 0; j < 18; j += 1) { ...

Sample source code for processing messages of a window created by an external program?

I know I have to use SetWindowLongPtr with GWLP_WNDPROC and create my own WndProc that handles the message I want (such as WM_GETMINMAXINFO and modify the MINMAXINFO structure). However, because I want to do this for a window created by another program (like notepad.exe), I can't do this from my C#/WinForms program, I have to create a n...

How can I tell when a screen's WorkingArea changes (i.e. task bar is moved)?

I have some windows docked to edges/corners of the working area, and I need to know if/when the WorkingArea of the screen changes so I can update the position of those windows. I've attempted to tackle this before to no avail, as I recall. ...

Encapsulating a Windows.Forms.Button

I want to define a special kind of button that only allows two possible labels: "ON" and "OFF". I decided to inherit from a Windows.Forms.Button to implement this but now I don't know I how should enforce this rule. Should I just override the Text property like this? public override string Text { set { throw new InvalidO...

WinForms: Alternative to SplitContainer?

Are there any alternative controls someone can suggest to replace the WinForms SplitContainer? I don't like how the SplitContainer shows that weird, dotted strip when its selected and when its being dragged. I want to have the panels re-size as the user drags instead of on mouse up and not show any dotted strips when the splitter is bei...

C# Notification Form

How can I create in C# a Windows Form without taskbar (where the minimize and maximize button are placed). Thanks. ...

Windows Forms Autosizing in .NET

My C# project contains a form. There are some controls across the top of the form and some controls across the bottom of the form, as well as a FlowLayoutPanel in the center, all of which have been placed with the Visual Studio Form Designer. During runtime, controls are dynamically added to and removed from the FlowLayoutPanel, and b...

What is the difference between the Control.Enter and Control.GotFocus events?

This may be a basic question, but I have to admit I've never truly understood what the difference between the Control.Enter and Control.GotFocus events is. http://msdn.microsoft.com/en-us/library/system.windows.forms.control.enter.aspx http://msdn.microsoft.com/en-us/library/system.windows.forms.control.gotfocus.aspx Is it a differenti...

Getting the relative path to the rdlc report in my winform app.

I am automatically creating a PDF from some of our reports in a month-end process. I am running into a problem where ReportViewer.LocalReport can't find my report. Within the project, the report files are in "(project root folder)/Reports/report.rdlc". How do I set ReportViewer.LocalReport.ReportPath so I can reference my report file? I ...

C#: Windows Forms: Getting keystrokes in a panel/picturebox?

I'm making a level editor for a game using windows forms. The form has several drop down menus, text boxes, etc, where the user can type information. I want to make commands like CTRL + V or CTRL + A available for working within the game world itself, not text manipulation. The game world is represented by a PictureBox contained in a Pa...

winform - login form template

Hi folks, new to winform development. I am trying to add a 'login form' to my project in vs2008 but the template is missing. When i do 'add new item', i don't see 'login form'. However i do see mainform, aboutbox form templates. TIA ...

Need to convert string/char to ascii values.

Hi, I need to convert char to hex values. Refer to the Ascii table but I have a few examples listed below: char 1 = 31 2 = 32 3 = 33 4 = 34 5 = 35 A = 41 a = 61 etc Therefore string str = "12345"; Need to get the converted str = "3132333435" ...