winforms

How can I show a FolderBrowserDialog more than once?

In my Windows Form's Form_Load event, I want to show a FolderBrowserDialog to let the user select a directory, and if the directory they've selected is not valid (meaning it lacks certain files that the application needs), I want to show it again. However, when I create a new FolderBrowserDialog, it does not appear when I call ShowDialog...

How to scroll two components with one's vertical scroll bar only

I'm working on displaying lines numbers for a richTextBox on C#, I tried many components but non of them worked with me, so I'm working on my own one. I implemented that using the richTextBox + ListBox. But, I'm having a problem when scrolling the richtextbox,the ListBox wont scroll, also I need not the vScrollBar of the List box to ap...

How to bind entity model to WinForms DataGridView with specific column names?

Currently I am doing: var items = from t in entity.Items select new { Name = t.ItemName, Description = t.ItemDescription }; myDataGridView.DataSource = items.ToList(); The problem is that when bound to the DataGridView, I get two columns of "Name" and "Description". I want to rename these to "Item Name" a...

add behavior to group of windows form controls

I'm trying to mimic the web fuctionality of having a label over a textbox that shows the type of value the textbox should contain. I can add the events individually but I'm wondering if there is a way to add 'Behavior' to a set of controls. Please see example code: private void labelFirstName_Click(object sender, EventArgs e) { Hi...

Disable close button in windows form

I found this code over the internet but am unsure about how to use it. Also I need to enable it back after work is complete. Help please. Private Const CP_NOCLOSE_BUTTON As Integer = &H200 Protected Overloads Overrides ReadOnly Property CreateParams() As CreateParams Get Dim myCp As CreateParams = MyBase.CreateParams ...

ScintillaNET: I have a problem with margin fore color

Hey, I'm using the left margin of Scintilla component as my lines' numbers part, I changed the numbers fore Color, and that worked perfectly. But then, when I set the language in the Configuration Manager to "cs", I lost the numbers' color and it went back to black, I need the numbers' color, any suggestion?? ...

What tools are available to create a help file in Visual Studio 2010?

I need to write a help file for a WinForms app in Visual Studio 2010. Ideally, I'd like to use a tool that integrates with Visual Studio, rather than a totally separate tool. In the past I've used HTML Help Workshop, but this is ancient, and I recall it was a little funky to use. I also know there was a tool built into the Visual Studi...

Showing image / text on screen without forms in c#

How can I show something on screen wihtout using forms? Actually, I want to show some text and images popping on screen. ...

Add to listview from another form

I am wondering how I can update my listview in form1 by entering data via textboxes in form2. My code works fine if i put all the text boxes on the same form etc. I figured I needed some reference to the first form on 2nd but can't get it working. Any tips for putting me in the right direction would be nice, also any tips for any bette...

Print WinForms TextBox with Tab Formatting

I have been working on some code that prints a textbox that lists contact information. When I try to print it, it doesn't print out the tabs that I used to format the text. Here is my code: Private Sub PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs) _ Handles prndoc.PrintPage Dim fnt As Font = resultTextBox.Font ...

Scrolling text using a toolstriplabel on a c# winform

Hi, I am currently working on a little app that scrolls a message across the top of the form - nothing complex however i have ran into a issue where i can not get it to work with a toolstriplabel on my c# winform. I currently have it working by the following method using a normal label but toolstriplabels dont appear to have the .Left o...

Slide object using For Loop (C#)

Hey All, I did quite a bit of searching around and didn't find anything of much help. Is it possible to "slide" or "move" using C#, an object from one Location to another using a simple For loop? Thank you ...

C# windows form application

i am trying to go from one form application to the next by clicking a button, how do i do it? ...

Toolstrip tablelayout style

using c# 2008 winforms. I may be missing something obvious here, but can anyone help me out with using tablelayout style in a toolstrip. I was expecting it would be similar to using a tablelayout control in the designer, and being able to use the desinger to assign controls in the toolstrip to a grid tablelayout of some kind, but none o...

Getting in message loop of external application

Hello, I need to retrieve values from an external application but it does not provide any API to do so. The values are ever-changing and not fixed. Is there a way to retrieve the values from the application? Maybe getting into the message loop for that particular application and filtering for certain window messages which contains t...

How do I display all error messages on a Windows Forms in like a error summary control?

I have a windows forms, and when I hit submit, it'll use the Error Provider class to display a little red error icon next to all the fields that are invalidate and display the error message as a tooltip. Is it easy to have all error messages of the error provider be displayed in like a summary box or a strip on the top of the form? I k...

Block User using Windows forms - c#

I am working in a windows application using c#. My application have 5 forms totally. My program controls all the 5 forms to block the user for different reasons they are invoked based on the UDP message my program recieves. Only one form will be UP at one time. I want the behavior of all the forms such like It should block the entire scr...

WinForms - action after resize event

Hi, Is it possible to perform a specific action after the resize event (of the user control), for example when mouse button is released? I need to manually resize an inner control and doing it on every single firing of the event would be quite, hmm, inefficient... ...

How much time takes a form to resize?

In order to compare performance of custom drawing I need to calculate the time a form takes to resize (or maximize - pass from its normal to maximized state). Where should I start / stop the StopWatch? Tried OnResize/OnSizeChanged and also OnResizeBegin/OnResizeEnd but both depends of how quick I drag the mouse... ...

In a STA thread: Form.Hide() = BackgroundWorker event not firing??

Hi, I want to hide the main window while the backgroundworker is working, but When I set the main form as this.Hide() before the backgroundworker.RunWorkerAsync(), Both ProgressChanged and RunWorkerCompleted are not firing. How can I achieve this? thanks. More code: ProgressChanged and RunWorkerCompleted are firing with: private void b...