winforms

How can I make a WinForms Form work as a DockableContent in AvalonDock?

I am able to use WinForms controls, but not an entire form: var foo = new DockableContent(); foo.Title = "Foo"; foo.Name = "FooName"; var c = new WindowsAppFramework.RenderTargetUserControl(); c.Dock = System.Windows.Forms.DockStyle.Fill; c.AutomaticUpdateFPS = 60; var host = ne...

.net security exception

I am using OpenFileDialog class to browse a file in window application using c#. It is giving the security exception as below. Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. My code is OpenFileD...

how to update a windows form GUI from another class?

Hi, how do you update a win forms control (ex. label, progress bar) from another class which created the GUI but not in the creating thread? (for example, an event handler of Program.cs) I've found several posts regarding updating GUI from another thread using Invoke() method, but what i've found so far only works if the codes are writt...

what is a recommended way to create a dependency for a windows forms application?

I want to associate a text or xml file with my project. So when the applications gets published this text file should tag along. How do you do this in visual studio? ...

Passing values between two windows forms

The case is this, I have two different forms from the same solution/project. What I need to do is to extract the value of a label in Form A and load it into Form B. As much as possible, I am staying away from using this code since it will only conflict my whole program: FormB myForm = new FromB(label.Text); myForm.ShowDialog(); What I...

Implement Binding List In a Control

Hi All, I have a (Image) User Control on a Winform .. I want to bind this Control to a binding list such that whenever the (images) collection changes the (images showing on the ) control also change. (should reflect the images within the collection). [something similar to an AsyncBinding List.] . Similar to how .net controls use Data...

how to wordwrap text in tooltip

How to wordwrap text that need to be appear in ToolTip ...

Listview ItemSelectionChanged fires twice?

I have a Winforms App in C# with a ListView control. This ListView shows a list of TO-DO items and I am using the 'ItemSelectionChanged' event to handle updates. The problem is that the 'ItemSelectionChanged' event fires twice each time I try to make an update. The ItemSelectionChanged event refreshs the form to represent the update...

how to insert any text to any website using C# code ?

hi i have any website that has 4 textboxs i need to insert the word "YES" to textbox number 2 how i can do it using C# winform code ? thank's in advance ...

Changing WinForm Button Text Color?

Hi, quick question I'm wondering if it's possible to change the color of a WinForm Button's text. I'm looking at the font properties, and can't find anything, but I feel like something as simple and (in my mind) practical as this should be possible ... ...

How to get Block Style Progressbars in Aero / .NET 4

I have three ProgressBars of the three styles. Blocks and Continuous are now rendering the same, whereas I remember Blocks used to render as Blocks. is this unique to .NET 4, Aero Glass, or Windows 7? How can I tell my app to use the classic Blocks? ...

How to prune main form code in Visual C++?

I am working on a rather large WinForms application that has dozens of controls and hundreds of functions. Right now MS makes every new event handler in the main form's .h file, and this file is growing out of control. It currently numbers in the thousands of lines, and is still growing. What is the best way to split up the code in a b...

Winforms/ActiveX cross threaded calls

I have an application wherein I am hosting multiple types of content (images, PowerPoint presentations, videos etc) in a kiosk-type app. The user has to be able to page back and forth between these bits of content, preferably using gestures of the touchscreen on the kiosk, i.e. tap one side of the screen to go forward, the other side to ...

my .net program is causing a BSOD

I am getting a blue screen when my windows winform application is run. It seems that only one user is getting this. I am not sure where at this time to look for the problem. I am however using some code that I found on CodeProject to trap mouse events and keyboard events http://www.codeproject.com/KB/cs/globalhook.aspx could this possibl...

Closing A Specific WinForm?

Let's say I open a form in the following way: FormSomething FormSomething = new FormSomething(SomethingId); FormSomething.Show(); In my code, there is a possibility for many FormSomething's to be open at once. How do I close a specific instance of a FormSomething? Each instance of FormSomething has an Id associated with it. Edit:...

How can I change the appearance of a Winforms TreeView SelectedNode using C#?

I can set the Treeview selected node using code, but it's appearance does not change. TreeNode selectedNode = treeView1.SelectedNode; TreeNode newNode = new TreeNode("I am new"); selectedNode.Nodes.Add(newNode); treeView1.SelectedNode = newNode; When I select nodes using my mouse the background color and fore colors change. I want...

"Unable to update dependencies of the project" after commiting to Subversion

I have a setup project in .NET. When I save the project and the other projects to subversion, the setup project no longer compiles. I get the error "Unable to update dependencies of the project." Any ideas why? ...

WinForm dataGridView equivalent of OnItemBound from WebForms found in repeater, datagrid etc

Hi, I'm new to WinForms, I'm essentially a web developer who needs to build a winForm app. I've search around and I can't find an equivalent method to OnItemBound for a dataGridView. thanks for the help. ...

Getting the ListView ItemCheck to stop!

Following some SO advice I have tried the following on the ItemCheck event of a ListView control: private void lstTasks_ItemCheck(object sender, ItemCheckEventArgs e) { ...some code return; } The idea being that that return; will cancel the event ...but does running some code before the blank return; negate the de...

How can I target multiple versions of .Net in a single application transparently to users?

I want to take advantage of the new features of WPF without breaking users that don't have .Net 3.5. I suppose if it doesn't already exist in .Net I would just need to build a loader exe that loads and executes either the .Net 2.0 or .Net 3.5 version depending on the current environment. Any better ideas? ...