winforms

Light richtextbox control for .net (winforms)

Is there any light version of richtextbox control? I've got to create like 300+ of them in an app which takes time, memory and slows everything down... All that I need is to have a control that will enable me changing the background/foreground of a part of the text... I'd need that in winforms... anybody know anything about some kind of ...

How do I tell if a form is in help mode?

There's a certain control which I don't have the source to (Steema TTree) it doesn't send a help message when help is requested through the form. (clicking the ? near the X on the dialog, then clicking the TTree) I can just call help directly on the form and pass in my own helpmessage, but I don't know whether the form is in help mode....

Correct use of Properties to maintain a HUD in a nested Form?

Edit 1 Is it possible to do this with get/set? Something like the below? This works for me but I am worried I am missing something not to mention all the staticness. ///<summary> /// Class to track and maintain Heads Up Display information ///</summary> public static class HUD { ///<summary> ///Declare variables to store HUD ...

DataGridView Scaling

In VB.net 3.5 SP1 I have a Windows Form with three DataGridView controls. One DGV takes up the whole bottom half of the form. The other two share the top half and are side-by-side. I'd like to have each DataGridView scale appropriately. More specifically I'd like to have column widths and row heights adjust to the size of the form....

WinForms RadioButtonList doesn't exist?

I know that WebForms has a RadioButtonList control, but I can't find one for WinForms. What I need is to have 3 RadioButtons grouped together, so that only 1 can be selected at a time. I'm finding that I have to do this through code, which is a pain. Am I just not seeing RadioButtonList somewhere, or does it really not exist in WinForms?...

Windows Forms: Multiple default buttons?

In a simple Guess-The-Number game I'm making, the user inputs a couple of numbers and hits a button. A second panel becomes enabled and the original one is disabled. The user now enters a number and hits another button, multiple times. Since the two panels will never be enabled at the same time, I'd like for both buttons to be "default",...

How to create custom PropertyGrid editor item which opens a form?

I have a List<> (my custom class). I want to display a specific item in this list in a box on the PropertyGrid control. At the end of the box I would like the [...] button. When clicked, it would open up a form which, among other things, would allow them to pick one of the items from the List. When closed, the PropertyGrid would be updat...

Winforms RichTextBox Pagesize ?

When I am viewing a document in Wordpad (or Word) the text is word wrapped around the document boundaries. Altough when I using the RTF string in a RichTextBox the text is wrapped around the control border. This means when I change the size of the window the wordwrapping changes. Is there something I can do about this ? (some kind of mo...

Ideas on how to display a modeless message box as a tooltip

I need to display a modeless message box whenever a user hovers over a menu item. I can't use messagebox.show(...) because it is a modal. So what I did was create a seperate windows form and display the form using the hover event on the menu item. I have 2 problems: 1) When the windows form displays the menu loses its visibility. 2) The...

Capture KeyUp event on form when child control has focus

I need to capture the KeyUp event in my form (to toggle a "full screen mode"). Here's what I'm doing: protected override void OnKeyUp(KeyEventArgs e) { base.OnKeyUp(e); if (e.KeyCode == Keys.F12) this.ToggleFullScreen(); } private void ToggleFullScreen() { // Snazzy code goes here } This works fine, unless a c...

For the .NET ToolStripButton, can I have a multiple line "Text" property?

I have a toolbar of images, and I want text labels underneath the images. Where the text labels are multiple words, I'd like to stack the words vertically. How can I do it? ...

What is the design reason for using a group box instead of a panel on a windows form?

So I am designing a control with a window s form. I want to group some controls together with a caption. So naturally I would go with a GroupBox. However is there some advantage in using a panel instead? Something not immediatly obvious to one who is still a little green with form design? How about some "gotchas" as well. ...

Events in MDIParents Forms and Childs

How can I Handle MDIParent Form events in childs forms? for example in Parent Form I Have a option "search on child grid" and when that button got clicked, in the child form one row on grid get focused. Im using C# 3.5 Windows Forms Application Thanks in Advance ...

Relative Paths in Winforms

Relative paths in C# are acting screwy for me. In one case Im handling a set of Texture2d objects to my app, its taking the filename and using this to locate the files and load the textures into Image objects. I then load an image from a relative path stored in the class file and use a relative path that needs to be relative to Content/g...

ASP.NET Verses Winforms

Anyone know where i can find a good comparison between the "generally accepted" Pro's and Con's for developing in ASP.NET verses Win forms 2.0. Preferably something official. I need to make a presentation to my boss (not a techie at all) about the two, and am looking for something "official" to show him. I have found lots of things o...

How can I capture keys on a WinForms application when the application is in focus?

How can I capture keys on a WinForms application when the application is in focus? I have tried using the Form_KeyDown and Form_KeyUp events but they don't work the way I want them to. ...

In .NET (C#), how does one reference a variable in one WinForm from a child WinForm?

Given a public instantiation of a class in WinForm1, I attempt to open WinForm2 and eliciting DB parms do a query the results of which I would like use to fill the class instance in WinForm1. However, I cannot figure out how to access the class instance in WinForm1 from WinForm2. The class instance in WinForm1 is coded as a private mem...

winforms menu as array

I know it most likely possible to access a winforms menu like an array but I am not seeing it in the menu designer of VS2008? What I mean is, my app has a typical menu bar across the top, with multiple items on each drop down. As it is written (I inherited this code), each menu item is a separate name, i.e. myMenuOption1MenuItem myMenuO...

Why does the second for loop always execute faster than the first one?

I was trying to figure out if a for loop was faster than a foreach loop and was using the System.Diagnostics classes to time the task. While running the test I noticed that which ever loop I put first always executes slower then the last one. Can someone please tell me why this is happening? My code is below: using System; using System....

ALT-TAB Application Icon Pixelated

When a child window of my application is opened and I view the ALT-TAB menu, the application icon looks pixellated. I assume that Windows uses a low resolution version of the icon (16x16 pixel I think). What can I do that Windows selects the right version which would be 32x32 pixel? I assigned an icon to the window in question that has ...