winforms

Form Closing event

Hi all, I have a smartdevice project targeting windows mobile 6. In the top right corner is an X (provided by the controlbox). i have an event on the form_closing that i was hoping would fire when the cross is clicked. But it doesnt :-( Does anyone know why this event is not firing ??? Thanks :-) John ...

How to Retrive data and want to read data from XML in C#

Hi, I am using windows application and i have four combo boxes(comboeventname,combosendtype,comboType,comboschedule) in that form.... I have stored that combo values in to XML file by using XML writer... now i want to display tha datas in that combo boxes in form load event when form opns in run time... How to retrive that values from ...

Change default font of controls in winforms

Hi, Is there any way to change default font of controls in winforms. I must change font in about hundred font in recent project and it's coming next project with other fonts and I wanna at start setting properly fonts. ...

[C#, WinForms] Handle that Shift+F10 w(h)as pressed

I want to use the exclusive key to open context menu that are available in most of the new laptops and keyboards. This key is usually available between right ALT and CTRL key. I am not sure that it is always equivalent to "Shift + F10" ( or is it always equivalent to "Shift+F10" ?). My programs runs on Windows XP and earlier versions. ...

Hide console window in Windows Forms application

Hi there, I took over a Visual C++ project in Visual Studio 2005 from a colleague. It is a Windows Forms project (I assume). But when I start it, besides the Windows Form it also shows a console window. How do I get rid of this console window? I think it must be a project setting but I don't find it. Any help is appreciated ... ...

Implementing an Outlook 2007 style 'Group by box' using WinForms?

In Microsoft Outlook 2007 it is possible to drag items (ie From, Subject) from the Inbox to a 'Group By Box' that appears above the Inbox grid. What is the proper term for that kind of box? Where do I find some examples/samples on how to implement in a Winforms application? ...

Best way to develop a secured application. With .net

Hello, we are developing a windows application, and as most apps out there, there is a login form. What I don't like is that the login form validates the user and opens the main form if user and pass are correct. Simple as is. All the function calls etc are called without verifying the user and pass again, what should be the right thing...

Problem with .NET ToolStripMenuItem ImageAlign property

I am creating a .NET form application in Visual Studio 9. In the designer I have added a MenuStrip to where I have added ToolStripMenuItems (standard dropdown menu). To the ToolStripMenuItems I have added images by setting the Image property. The images appear as expected, except they are aligned to the left, even though the ImageAlign...

Custom Shortcut in Windows.Forms.Shortcut?

How would you go about assigning a custom shortcut in C# to a Menu item? Right now, it looks like it only uses what is available in the Windows.Forms.Shortcut enum. The combination that I want, Ctrl + DownArrow, is not available. Thanks. Chris For those interested in the answer, here it is: I specified the shortcut(s) in the code-b...

"Illegal characters in path." Visual Studio WinForm Design View

I am putting together a lightweight MVP pattern for a WinForms project. Everything compiles and runs fine. However when I attempt to open the WinForm in design mode in Visual Studio I get a "Illegal characters in path" error. My WinForm is using generics and inheriting from a base Form class. Is there a problem with using generics in...

Winform AutoEllipsis Width

I have a Winform label control with AutoEllipsis set to True. The label itself has a max size set and AutoSize set to false. When text extends the width of the label an ellipsis is displayed (...) and a tool tip appears on hover. This is great but the resulting toolip is too long. Is there anyway to control how the tooltip appears?...

C# Winforms Transparent Control allowing Clickthrough

I have a problem, a bit related to: http://stackoverflow.com/questions/855826/c-winforms-transparent-control-allowing-clickthrough Contrary to him i would like to capture mouseevents on my program, while still retaining a "window" to whats behind my program. color.transparent doesnt work, and transparencykey just delivers mouse events t...

Entity Data Model & DataGridView - Creating new objects

I'm pretty new to the EDM, so bear with me. I have a windows form that has a DataGridView on it that's bound from the EDM I created. I figured out how to update my changes fine, but it's when the user creates a new row that I'm having a problem. I tried numerous ways and many google searches, but came up with nothing so far. Here's h...

WinForms window drag event

Is there an event in WinForms that get's fired when a window is dragged? Or is there a better way of doing what I want: to drop the window opacity to 80% when the window is being dragged around? Unfortunately this is stupidly tricky to search for because everyone is looking for drag and drop from the shell, or some other object. ...

Adding rows to a data-bound DataGridView [Winforms]

I want to bind a table from a database to a DataGridView, but I want to also add one more row with a sum of the values in the columns with indexes 3,4,7,8,9... How can I do that? Thanks! DataTable table1 = new DataTable(); double brutoUkupno1 = 0; double porezUkupno1 = 0; double doprinos...

Override tooltip text for Titlebar buttons (Close, Maximize, Minimize, Help)

I have been trying without luck to change the text of the tooltip that appears for the buttons on the main title bar of a form. In a nutshell, we have harnessed the 'Help' button for Windows Forms to have some other purpose. This is working fine. The issue is that when hovering the mouse over that button, a 'Help' tooltip appears, whi...

minimize button for winforms form with sizabletoolwindow style

Any tips on how to simulate the minimize button & behaviour UPDATE - the minimize button needs to be on the caption bar as screen real estate is @ a premium ...

Combine master-detail databinding

I have created data sources from my objects in my project, some of which have other objects as members. When I want to bind a some objects to a data grid I would like to display some of the values from the member objects in the data grid as well but the examples I have come across seem to use an entire other datagrid or controls to displ...

graphics don't draw when loop condition is dates. c#, winForms

so i got this piece of code. (currPosX is defined earlier) while (earliestDate < DateTime.Today) { currPosX = currPosX + 5; e.Graphics.DrawLine(Pens.Black, currPosX, 0, currPosX, 10); earliestDate = earliestDate.AddDays(1); } the graphics don't draw. it's really weird, since this on...

How to get or set data from ComboBox in DataGridView

In C#.net I want to get or set data to ComboBox in each cell of DataGridView What should I do. Thanks. ...