winforms

WinForms and ShowDialog problem.

I have a borderless WinForms app. The main window creates other forms (simple dialogs where I can click yes or no) with ShowDialog(). Every created dialog is not visible in the taskbar, my app has only one taskbar entry that focuses my app (and if a dialog is open that one is focused). If I use ALT+TAB to cycle to all open windows I onl...

WinForms designer

I have a large number of forms with a lot of controls on them and i need to do specific actions with certain groups of controls. Is it possible to select all elements with the same type using vs winforms designer? or using other instruments? It's not a problem when i'm using custom controls where i can implement my own controlDesigner an...

Non-modal WinForms FontDialog?

Is it possible to display the WinForms "font picker" dialog non-modally? Or is there another font picker other than the standard one that can be used non-modally? Our application has many windows, and users who frequently need to interrupt what they are doing and switch to another window to look at something. If they use a taskbar butto...

How can I detect when a checkbox has been selected in a WebBrowser control from within WinForms?

In my winforms application, I have a WebBrowser control which displays a page. When the user checks/unchecks a checkbox, I want to detect that, and have an event do some processing within my winforms app. Any idea if this is possible? ...

WinForm Design?

I'm coming from a web dev background, and do ok, but with WinForms, everything I make looks like crap. Can you guys point me to resources with WinForm design principles that will make my WinForms easier on the eyes? Thanks! ...

Center current record in DataGridView

When programmatically changing the current record in the DataGridView is it possible to make it in such way that this record would be centered (vertically) in the grid? When I change the current record it is shown either as the top row or as the bottom row. I'd like it to be in the middle. Would this be possible/simpler in WPF? ...

Making ListView in a WinForm Sortable?

In Windows' file explorer, you can sort ListViews by clicking on the column header to sort by. Is it possible to add this type of functionality to a ListView in a WinForm? If so, how can this be done? Thanks! :D ...

How do I change a console application to send the output to a winforms listbox?

Right ive got a console application which outputs the data i need... to the console! All i want to do, is have a windows form start up before this data begins to produce and then the data instead of print to console, get added to a list box on the form. I dont wish to sound lazy but ive been going around in circles and im getting nowhe...

How do I detect a change of tab page in TabControl prior to SelectedIndexChanged event?

I currently determine what page of a tabcontrol was clicked on via the SelectedIndexChanged event. I would like to detect before the selected index actually changes, for validation purposes. For example, a user clicks a tab page other than the one they are viewing. A dialog is presented if form data is unsaved and asks if it's ok to pro...

How to correctly stop thread which is using Control.Invoke

I tried the following (pseudocode) but I always get a deadlock when Iam trying to stop my thread. The problem is that Join() waits for the thread to complete and a pending Invoke() operation is also waiting to complete. How can I solve this? Thread workerThread = new Thread(BackupThreadRunner); volatile bool cancel; // this is the thre...

WinForm resizing matrix?

WinForms (.NET 2) question: Is there a way to keep elements at a proportional distance when the parent form(or panel) is resized? Could I use Graphics.TransformPoints or Graphics.TransformVectors for this scope? How. EDIT: TableLayoutPanel will not work because superposed elements should be accepted. EDIT2: This is my code: usi...

How to allow user to set expressions detrmining property value in PropertyGrid

I noticed that programs like Report Builder allow user to set property value or an expression determining property value. I want to the add same functionality to my application. So is there any simple way to do so or do i have to redefine all type converters so that they allow to set expression in addition to their original functionality...

What's the simplest way to make a scrollable list of controls with labels?

Using C++/CLI and Windows Forms, I'm trying to make a simple scrollable list of labelled text controls as a way of displaying some data fields. I'm having trouble making a TableLayoutPanel scrollable - every combination of properties I've tried seems to result in some really peculiar side effects. So I have two questions: Is this the ...

Prevent some DataColumns in a DataTable from being bound to DataGridView

Is there any way I can specify that some columns in a DataTable will not be automatically bound to a DataGridView when I set the DataSource property of the DataGridView to the DataTable. For example, if I have a DataTable with columns as "Id, Name" then can I specify that Id column will not be shown in DataGridView? I know I can set som...

Use resource font directly in VB.net/C#

How to use resource font directly without saving font in local file system for standalone application[desktop application] in VB.net/C#? ...

C# windows forms not updating in method

Hi! Im trying to call some windows forms code (like setting label.visible = true in some event code, everything compiles ok, but form does not react to change! What could be the problem? Problem is in lines: labelNewCall.Visible = true; timerNewCall.Enabled = true; code : http://pastebin.com/gV28PN4P also other code did not work, u...

C# Why does this code not show a GUI properly?

class Program { static String ChannelName = null; static Form1 f; static void Main() { f = new Form1(); f.Show(); try { MY CODE WHICH CALLS INTO ANOTHER CLASS BUT CANNOT PASS THE GUI INSTANCE AS IT USES REMOTING } } } I know this isnt the best/normal w...

Clear type font usage in C#/VB.net

How to use clear type font in C#/VB.net ? ...

Any good tools or tips for fuzz testing Windows forms applications?

I'm maintaining a ~300K LOC C# legacy thick-client application with a Windows.Forms interface. The app is full of little bugs and quirks. For example, I recently discovered a bug where if a users edits and tabs (not clicks) through cells on a DataViewGrid, and leaves the a certain cell selected, the app gets an "Object reference not se...

Adding Events To WinForms?

Happy Friday! :D I have a TextBox on a WinForm and I want to execute some code every time someone presses a key inside of that TextBox. I'm looking at the events properties menu, and see the "KeyDown" event, but don't know how to add code to it. Happy coding ...