winforms

C# TabControl - is it possible to "disable" individual TabPages?

Is it somehow possible to disable one (or more) tabs of tab control? At some point I need to make user stay on the active tab and prevent him from leaving... I know I can disable the whole TabControl component, but that disables also all components on active tab... I also tried to use the Selecting method of TabControl: private void Ta...

Is it possible to configure the mono default font for menus?

The winforms default font for menus in mono (Ubuntu 10.04) does not support german umlauts. While I can set the font for form content (this.Font), I could not figure out where to configure the menu font. Any suggestions? Edit: I am now using a ToolStripMenu which uses Parent.Font as Font. Works fine. ...

Will a Winforms grid keep its datasource in memory? .Net

Hello I've a grid in my winforms application and i bind a huge dataset to the grid. Will the dataset be stored in the memory by the grid after calling DataBind(). How does it operate on the data binded to the grid? Update I wrote the following code DataTable dt = new DataTable(); using (SqlConnection con = new SqlConnection("...

Zoom a Rectangle in .NET

In a WinForm I use rectangles, ovals and lines of Microsoft.VisualBasic.PowerPacks. Is it possible to make a zoom on it? How? ...

VisualStyleRenderer and themes (WinForms)

I have my own TreeView control which is completely OwnerDraw'n: myTreeView.DrawMode = TreeViewDrawMode.OwnerDrawAll; What I try to achieve is to draw the opened/closed glyph according to the current explorer theme. Especially on Vista and Win7 boxes I'd like to see the new glyphes (black triangles) instead of the plus/minus signs. I...

Report Definition Grouping and Drilldown.

My question is regarding rldc file creation to be used in reportviewer control. The environment is vs 2008 and winforms. I have a the following situation. A company object which has a list of Employees. Each employee object has a list of CompletedTasks as well as the employee name,number and job type. A completed Task is a simple obj...

Hundreds of custom UserControls create thousands of USER Objects

I'm creating a dashboard application that shows hundreds of "items" on a FlowLayoutPanel. Each "item" is a UserControl that is made up of 12 or labels. My app queries a database and then creates an "item" instance for each record, populating ethe labels and textboxes with data before adding it to the FlowLayoutPanel. After adding abou...

Is prefixing Windows Forms control names with their type OK?

Possible Duplicates: Why shouldnt I use Hungarian Notation? Best practices for C# GUI naming conventions? I have seen many responses that say that prefixing variables with their type is bad, since C# is statically typed and we have Intellisense, but I find that prefixing the names of the controls is useful because I don't ne...

Enable debugging in Design mode in VS

Is there any way to enable debugging from within the Windows Forms Designer in Visual Studio (any version, up to and including 2010)? What I mean is, say I have some custom user control, and this control has certain validation that it performs when I set a particular property. I'd like to be able to set a breakpoint somewhere within tha...

Tray Icons Keep On Popping Up

I have a WinForm program that checks a database for changes, and if there are any, it will open another WinForm telling the user what is happening (the popup WinForm has some special functionality making a MessageBox insufficient for this task). Each time one of these popup WinForms shows up, a new icon shows up in the system tray and d...

Find the rectangle of the currently selected item in a list box

I need the find the rectangle (or really just top, left point) of the selected item in a List Box. Any one know how to do it? ...

Why is UseCompatibleTextRendering needed here?

Hi, I think I'm missing something fundamental. Please tell me what it is, if you can. I have developed a little C++ WinForms app using VS2008. So it is built using .NET 3.5 SP1. My development box is Win7, if that matters. The default value of UseCompatibleTextRendering property in WinForms controls is false in this version of VStudi...

how to adjust sliding of scroll according to the value calculated by me?

I am working on scroll. I have made a program wherein if the scroll box is in particular range of the panel then it automatically moves to a particular position in the slider. For eg, I have a panel of size 500. the scroll has height of 100. Now the total intervals are 5. Now if i slide the scroll box at a position 225 then i want that i...

Error displaying a WinForm in Design mode with a custom control on it.

I have a UserControl that is part of a Class library. I reference this project from my solution. This adds a control from the referenced project to my toolbox. I add tghe control to a form. Everything looks good, I compile all and run. Perfect... But when I close the .frm with the control on it and re-open it, I get this error. The code...

Obtaining MFC Feature Pack GUI elements in .NET WinForms

The MFC Feature Pack (and VS 2010) adds out-of-the-box support for several "modern" GUI elements (such as MDI with tabbed documents, the ribbon, and a Visual Studio-style interface with docking panels). These are a boon to those of us that have to support legacy MFC-based applications and want to update their look-and-feel, and a sign th...

Disable digit substitution

How can I disable the digit substitution (for example for Hindi numerals instead of Arabic ones) for my application (native c++) completely? I want all the numbers displayed with 0123 instead of ٠١٢٣ There is an option in localization options in windows, but I don't want to change that for the user. Only for my app. Thank you! ...

PropertyGrid - is it customizable?

I have a project in that we have to represent some graphic objects on a usercontrol in WYSIWYG. Also is required to edit each objects properties(Color, Location, etc). I hesitate between using PropertyGrid ('direct' properties edit) and custom forms on DoubleClick ('indirect' edit). The PropertyGrid is very well but should correspo...

Is there any validation control available in .net win forms like asp.net web form?

Is there any validation control available in .net win forms like asp.net web form? Because it difficult to right condition for each control in my from also there are many repeated code in my form. Can u please suggest right way to do this.. ...

List Form controls in a Combobox

[.NET 2] how should I list a form controls in a Combobox of the same form(like VS designer does)? I tried: cboObjectSelection.DataSource = Me.Controls but this does not work. Is there a possibility to filter(customize) this list? ...

How to show processing form in my main form

Hi I want to show processing image in form when my main form is working. I have created processing form . I tried it with ProcessingForm obj = new ProcessingForm(); obj.show(); DOSomeStuff(); obj.close(); it shows processing form..but some time it becomes not responding...or my gif image stops animating. How to do that?? ...