winforms

.NET Block Diagram Component

I'm looking for an affordable diagramming component for a C#/.NET (WinForms) application that will let users create diagrams like this one: What would you recommend to me? ...

DataGridView no CurrentRow

Hi! Is there way to set CurrentRow in DataGridView to null when form is first loaded? So BindingSourse event CurrentChanged should not fire. What I want actually. When form is loaded no rows are selected in DataGridView and BindingSourse.CurrentChanged is fired only when user selects some row. ...

VS2010 Winforms Usercontrol changes not showing in parent form

I've created a series of usercontrols. Dragged one of the controls to the main form. It shows OK. Went back and made a change to the design of the user control. Rebuilt project. Cleaned project. manually removed all project binaries including the obj folder. Change still doesn't show on the usercontrol hosted on the main form. Drag...

The intended purpose for <app name>.exe.config file in a VB.NET Forms app.

I am currently reading up on documentation for a possible assignment I might be put on. In a design document they talk about the .exe.config file. They state that its only purpose is to store constants: "Also note that this file is meant to store constants only, it is not meant to write configuration values to (and the .NET 1.1. frame...

Which books should I invest :) to learn everything about developing a windows form using visual studio 2010?

I'm aiming at the skill measured listed in Microsoft certificate 70-511 but not sure which book(s) to learn from. If you were me, what would you recommend? ...

Changing the node value of treeview

Hi all i have written a code to move a file from the original path to the new path this was working fine. Initially my treeview will have a root node and i am adding child nodes at the run time. My tree is as follows Root |->C:\some.txt(Assume that it is in c drive) Now if i right click on that i will have a context...

How to create a Loading Window?

Ok, in my app there are times when loading the DataGridView can take a minute or two. What I want to do is show a GIF in a form with no border until it reaches the end of the loading function. However, if I do: Views.Loading ldw = new Views.Loading(); ldw.Show(); ... ldw.Close(); ...it never actually draws it to the screen and I ca...

Prevent WinForm AcceptButton handling Return key

I have a form with a button hooked up to the AcceptButton property so that logic occurs and the form is closed when the user presses the Return key. On that form I display a dynamically created TextBox that appears when the user double-clicks a certain area then hides when the user presses Return. How do I prevent the form from process...

add default to database populated dropdownbox

I have a dropdown list that is currently populated from a result set of a stored procedure. The datasource for the DDL is set to the resultset. Without inserting a default record into the database (I don't want to do this) how can I add an item to the DDL which is the default selected item on form load? ...

changing triggering order of conflicting shortcuts of menu items

I'm assigning same shortcuts to several menu items, and i need to control their priority. for example i'm assingin F3 for subitem in second menu item, then assigning F3 for subitem in first menu item. When I press F3, the onclick action triggers only for second menu item, and i don't know how to change this order. Changing order of menu ...

Is there a Form event that gets called right before anything is drawn to the screen?

I've tried overriding the OnLoad event, but the form is getting drawn before this method finishes. I am calling the base.OnLoad method. But, the form is partially getting drawn (artifacts are seen) during the event. I notice this because I'm hitting the database and it is taking some time. In the event, I'm getting some data and bind...

Disable OnPaintBackground without subclassing Panel?

Is there any way to disable the erasing of a panel without subclassing Panel and overriding OnPaintBackground? I am trying to achieve a double buffering effect without subclassing Panel. I understand that this may be a weird thing to try to do, but I'd at least like to know if I can or not. The following code sample illustrates this: p...

How to convert a System.Drawing.Drawing2D.LinearGradientBrush to a System.Windows.Media.LinearGradientBrush ?

I trying to port System.Drawing: public LinearGradientBrush( Rectangle rect, Color color1, Color color2, float angle ) to System.Windows.Media . I can get the angle to be correct but I can't get the start and end to be at the corners. I have tried scaling the brush's transform but that ends up messing the angle. Syste...

Hidden Id With ComboBox Items?

I know how to add items to a ComboBox, but is there anyway to assign a unique Id to each item? I want to be able to know which Id is associated to each item if it is ever selected. Thanks! ...

.NET 3.5 - Open a PDF directly from stream in native viewer.

I'm working on a WinForms C# 3.0 / .NET 3.5 project involving building some canned reports. One of the requirements of the project is to export to PDF format, and currently doing so to disk is working just fine. The question was raised, however, if it's possible to export the file to a stream and open it directly in the native viewer o...

How can I print Winforms DataGrid to paper?

How can I print a System.Windows.Forms.DataGrid to paper? I'm using .NET 3.5 framwork in C# ...

Child form looses focus on first click to parent form. How to fix this?

Im writing a new plugin based app. This loads assemblies in their own app domains and displays the specified main forms within each via Application.Run(pluginForm). I set the main form in the loader app as the parent of each pluginForm before calling Application.Run(pluginForm) inside the app domain. Hence when the pluginForm shows it al...

Add a hyperlink column for a Winforms DataGrid control

How can I add a hyperlink column for a Winforms DataGrid control? Right now I am adding a string column like this DataColumn dtCol = new DataColumn(); dtCol.DataType = System.Type.GetType("System.String"); dtCol.ColumnName = columnName; dtCol.ReadOnly = true; dtCol.Unique = false; dataTable.Columns.Add(dtCol); I just need it to be ...

What .Net controls are available for diagram markup?

We need to mark up diagrams of body parts to indicate the location and extent of injuries. For example, to shade an area of the body to mark a burn, or a diagram of a hand with an amputated finger. What 3rd party controls are available that would be suitable for embedding into a .Net application? ...

Can disabling a control cause a radio buttons value to change?

I have a For Each loop going through the controls in a panel disabling them. When the loop reaches one certain grid control and disables it the CheckedChanged event fires for the next control in the loop which is a radio button. The call stack is as follows: System.Windows.Forms.dll!System.Windows.Forms.RadioButton.OnCheckedChanged(Sys...