winforms

Resizable windows controls?

Hi, I am intersted whather I can make controls like treeview, RTF or tabcontrols resizable (I guess I can) and how. I know about using splitters but those only enable to make two areas to "overlap". Thank you! ...

WinForms.TreeView - The best way to filter nodes

Hello everybody, Whats the best/efficient way to filter a Treeview nodes using WinForms.TreeView? For example: I typed "abc" and only the Nodes contained "abc" become visible. Then I typed "abcd", and I should to see the only Nodes containing "abcd" text. And so on, so each time I changed filter criterion the treeview content is also c...

Winforms: Best way to keep winforms app unlocked?

I have a winforms app, that's locking up during a web service request I've tried using doEvents to keep the app unlocked, but its still not responsive enough, How can I get around this locking, so that the app is responsive at all times? ...

Format date from SQLCE to display in DataGridView

hi folks, I have a DataGridView bound to a table from a .sdf database through a BindSource. The date column display dates like "d/M/yyyy HH:mm:ss". e.: "27/2/1971 00:00:00". I want to make it display just "27/02/1971" in its place. I tried to apply DataGridViewCellStyle {format=dd/MM/yyyy} but nothing happens, event with other pre-built...

Delete a Row from a DataGridView given its index

My DataGridView is a single line selection and theres a rowEnter Event where I get the line index every time the selected line changes. private void rowEnter(object sender, DataGridViewCellEventArgs e) { currentRowIndex = e.RowIndex; } when I press a delete button I use the same index to delete the row ...

Insert a Row with a sorted DataGridView

My DataGridView is bound to the same BindingSource as the Insert Form, and the Name column is sorted. After insert is done, the groupBindingSource.Current is not returning the new inserted DataRowView but the last row in the sort order what makes the Update do nothing. FormGroup formGroup = new FormGroup(); formGroup .So...

How can I add a spellchecker to a Richtext box?

How can I add a spellchecker to a richtextbox in my application? ...

Can't move treenode to listbox in c#

Hi: I am having a problem moving a treenode in a treeview to a listbox. The code is pretty straight forward. I just can't figure out why. Here is my code: In window form's constructor I have: this.ScriptTestTreeView.ItemDrag += new ItemDragEventHandler(ScriptTestTreeView_ItemDrag); this.ActiveScriptListBox.DragEnter += new DragEventH...

Select newly added Row - DataGridView and BindingSource

I'm adding a new Row to a BindingSource that is Bound to a DataGridView source.AddNew(); After this, use BindingSource to get the newly added row is return the next row in the DataGridView when its sorted. ROW "A" ROW "B" <- myBindingSource.AddNew(); ROW "C" myBindingSource.Current gives ROW "C". (it became the selected row in the ...

In a C# GUI program how do you move a tab control to the front on the click of an object?

In a C# GUI program how do you move a tab control to the front on the click of an object? I have a picture box on the main tab, when the user clicks on the picture box, I want the second tab to be pulled forward. Visual Studio 2005 Cheers. ...

Windows Forms Timer bug or bad use?

When programming a small OpenGL application using Windows Forms, I discovered something using a profiler that I thought was pretty wonky. I'm using a System::Windows::Forms::Timer to detect a combination of mouse idling and some other user input. The tick functionality is useful, but on occasion I want to 'reset' the timer. You can't r...

Trouble with "flickering" when updating a panel's children.

I have a TableLayoutPanel that contains rows of labels. This control lives on form with a gradient background. The labels are updated periodically, usually as a whole set. When they are updated, they update very slowly and it is very visible to the user. I have tried using DoubleBuffered on the form, but as expected, this didn't help...

Communicate between two windows forms in C#

I have two forms, one is the main form and the other is an options form. So say for example that the user clicks on my menu on the main form: Tools -> Options, this would cause my options form to be shown. My question is how can I send data from my options form back to my main form? I know I could use properties, but I have a lot of opt...

Multiple selection in a TreeView

I am using a Windows Forms TreeView control in my program. I would like to allow the user to select multiple nodes at the same level by dragging their mouse pointer around (also called a "lasso" selection). I don't think a standard TreeView allows that. My question is what would be the best way to achieve this? Do I have to write custom...

Winforms: Backgroundworker on abort method?

Is there an event for onAbort for the backgroundworker control? ...

Winforms: Background worker - best way to KILL it

I noticed the background worker has a backgroundWorker1.CancelAsync(); method, but when you call this method, you still need to add code in the worker method, to check for a cancellation request. All this is polite and fine, but what if you just want to KILL the thread immediately? How is this done. I want to annihilate the thread, do ...

Creating a class in c#

I have read the docs and everything but I'm very confused. I never needed to create a class before and now I do. I want to have something like: TextDocument.Save("filepath", "contents of file to save"); and stuff like: Application.Create("filepath", "text/code to save"); and: Stylesheet.Save("filepath", "contents"); and have th...

Is it possible to get the position of a specific tab in a tab control?

I'm trying to get the .Left property of a specific tab page in a tab control (based on the header), the .Left and .Right properties seem to return the position of the tab control itself, not the specific page. I want to align a label with the tab page header, the problem is that the page can move depending on whether other tab pages are ...

.NET C++. Creating an instance of Form

Hi, I have tried to create a simple app with .NET C++ (I come from C#) but I failed just on the beginning. I have created winforms project and add Form2 to the project. The compiler keeps reporting that Form2 is not a member of my project. What I need to do in order to create an instance of that Form2? Thank you! ...

c# how to handle internet interruptions

My program is downloading data from a server, once he received all the data, my program handles the data (performs checks like if that data is still on the server) and saves it into my database. Now I was wondering what if my internet connection suddenly is disconnected, what happens with the data that I just was receiving. So I did a t...