winforms

How to quickly add a single printout to a simple .net winforms app?

I've nearly completed a tiny winforms app (.net 3.5) and the last thing remaining is a printout. The printout is pretty simple. It is printed on an A4 landscape page and consists of three identical columns (those are 3 copies of a support ticket). Each column has a bit of fixed text, a logo image, and a few fields from an object. In case...

How to create a parent-child structure in WFA TreeView having a list

I have a List of structs: public struct NodeIntHwnd { public TreeNode Node; // a treeNode with a string public int Level; // level of depth public IntPtr Hwnd; // not important }; They are sorted in a List sth like: { This is a node, 0 // root This is a node, 1 // level down This is a node, 2...

Accessing data on another thread

Hello! I have a winform and some threads. When i try to access a field in the winform from one of the threads, the following error occurs : Cross-thread operation not valid: Control 'richTextBox1' accessed from a thread other than the thread it was created on. How can i resolve this problem? Regards, Alexandru Badescu ...

Graph drawing VC++

I'd like to know, how coordinates can be transformed to center of the form for drawing mathematical functions. I already tried ->TranslateTransform(x,y) on Graphics object, this works, but only in one quarter of coordinates. How should I draw math functions on the form?Programming C++ long, but WinForms and Drawing are new 4 me. ...

DataGridView UserDeletingRow Not Firing

Consider 2 DataGridViews both with SelectionMode = RowHeaderSelect. In grid1 I have 2 columns; a TextBox and a CheckBox. In grid2 I have 2 columns; a ComboBox and a TextBox. When I click on the RowHeader, the focus goes to the first cell, not the RowHeaderCell. When I press the DEL button, the contents of the cell is deleted (TextBox ...

What format does the TreeView control need in order to create a Tree?

I have a simple table in my database called Department. In it there's a column called ParentDepartmentID that is a self referential foreign key ID. Here's an example of the data I have for testing purposes: As you can see, Departments: Diagnostics and XRay are children to Office of Chancellor. And Laboratories is child to Diagnostics....

Generating unique HTML ids in Rails when using a repeated partial that has form_for

I have a view on my current project which does something like the following(in haml): [email protected] do |horse| = render :partial => 'main/votingbox', :locals => {:horse => horse} The in the _votingbox.html.haml file I have the following: %div.votingbox %span.name= horse.name %div.genders - if horse.male %img{:src => '...

ArgumentException was unhandled.

Here's a screenshot of the error: The error itself is: The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid. Going to the app.config file of that same project I can find: <?xml version="1.0" encoding="utf-8"?> <configuration> <connectionStrin...

GeckoFX or Webkit.NET local storage?

I'm aware of the two projects to brink Gecko or Webkit to C# windows forms, but can someone who has used them tell me how much support they give to new HTML5 technologies like local storage, etc... I'm not totally sure if gecko/webkit themselves offer this as they are just rendering engines, or if it is the web browser application that ...

Ways to quit application after launching multiple winforms ?

Let's say I launched multiples winforms from Program.cs with Form1 form1 = new Form1(); form1.show(); Form2 form2 = new Form2(); form2.show(); Application.Run(); How do I quit application when all forms are closed by User ? I can of course put Application.Exit() in FormClosed event but it's not very elegant I think. Are there other w...