winforms

DataSet changes not being persisted to database

I have a windows form with a number of data-bound fields relating to a client. Additionally, I have a DataGridView showing orders for the currently displayed client. This is achieved using the design-time Visual Studio controls (e.g. a project DataSet, BindingSources TableAdapters and a TableAdapterManager. When loading the form to edit...

MS charts: winforms

http://code.msdn.microsoft.com/mschart How to get the background that is specifed in the link for winform ms charts? is there a xml file for the settings? ...

Nhibernate, WinForms, Castle Windsor: Session Management

Hi, I know the question of session management has been brought up in the past, but I could not find anything that helps me overcome my problem.. I have a number of repository classes (e.g CustomerRepository, ProductRepository etc.) which I resolve through Castle Windsor (Note: I am trying to apply the three calls pattern as outlined he...

Is it possible to bind dynamic properties to WinForms control properties?

I'd like to bind dynamic properties to WinForms control properties. In the following example I bind the IsAlive property of a thread to the Enabled of a button. using System; using System.Windows.Forms; using System.Threading; namespace ThreadTest { public partial class Form1 : Form { Thread thread; public Form1() { ...

How to handle Illegal Chars in XML

How should I handle this situation? I set the Encoding to UTF8 but I still get errors... I create that string (that I set to the WebBrowser.DocumentText) from a MemoryStream object and I'm ending it like this: Byte[] buffer = new Byte[ms.Length]; buffer = ms.ToArray(); return System.Text.Encoding.UTF8.GetString(buffer); What a...

AddOwnedForm - add WPF Window?

I'm working with an existing WinForms form. I'm trying to interface a new WPF Window with it (to replace an old form). The old code called mainForm.AddOwnedForm(newForm);. I know that that makes the new form somewhat of a child of the main form -- it's hidden when the main form is, etc. Is there a way for me to link a WPF window to t...

How to Update DataRepeater Bound Datasource without flicker

Hi, I have a list bound to a datarepeater which contains data being scrapped off a web site. Because the scrapping process could take some time, I binding the list to the datarepeater at the outset so the user can start seeing the results. As I add entities to the list, I'm calling: bindingSource.CurrencyControl.Refresh(); This is cau...

Winforms Grouping Gridview

Is there anyway to create a grouping GridView in c# Winforms. for example I have the following data coulmns: Manager name : Number of reportees : Reporting Manager name : Designation I want this to be grouped based on designation as follows: Project Manager Manager name : Number of reportees : Reporting Manager name Associate Project M...

Structuring the WinForms in my presentation layer

Hi Everyone, At our company we are developing an application that has a large number of winforms that are all created in the same UI layer, namespace and assembly. Is there a decent way / design pattern to structure this layer? Our UI layer communicates with the business layer wich consists of mutiple namespace like business.calculatio...

How to hide infrequently used menu items in .net windows forms application?

Most folks will know the behavior of ms office applications menus: When opening a menu, the user at first only sees the menu items which are used frequently. Hovering over the menu with the cursor or clicking on a small "arrows" symbol expands the menu to show all items. Still the formerly hidden items have a lighter background color. Wh...

How to select, display and save regions of a graphic?

So here's the situation: I need to take a (user-specified) graphic, and allow the user to define and label regions within that graphic. For example, if you uploaded a picture of a face, you might want to define "right eye", "left eye", "nose" etc. Also, having defined the regions, if I select a previously defined region, it should be h...

How to stop a bindingSouce/ComboBox from changing selection

I have a simple form with list as a data source, a binding source bound to the list, and a combo box bound to the binding source with some fields editing whatever the bindingSource.Current is. What I would like to do is if a bool is set pop up a dialog asking if they want to save changes before they change items. If they say no I want to...

Interface implements a different interface, causing issues binding to Combobox

I am learning Fluent NHibernate and this issue arose from that project. I have a base Class and a base Interface: public abstract class Base : IBase { public virtual Guid Id { get; set; } public virtual bool IsValid() { return false; } } public interface IBase { Guid Id { get; set; } bool IsValid(); } ...

Scrollbar flicker when calling EnableScrollBar

I'm using p/invoke to call EnableScrollBar from user32.dll (MSDN reference). I noticed that when the scrollbar is enabled, it seems to draw as though no theme is applied and then re-drawn with the theme applied. I've only tested with Windows 7 so far. Is there any way to stop this from happening? EDIT: Here's some code to show what hap...

How to use an invisible System.Windows.Forms.WebBrowser?

I tried to run it without a container form, but the DocumentCompleted event doesn't fire. I tried to run it in a Form with opacity set to 0% but the process isn't completely hidden, since it appears to the user when he uses Alt+Tab I don't mind if the proccess appears on the Task Manager though. ...

VB.NET Winforms menu item shortcuts overriding default shortcuts?

In a VB.NET Winforms application, I have a form that contains both a datagridview and a textbox. I have some menu item entries that have shortcuts of Ctrl-X, Ctrl-C, and Ctrl-V that operate on the datagridview. However, these override the default cut, copy, and paste shortcuts for the textbox. How can I make the menu shortcuts only ap...

Do Windows Forms Controls run without the form?

Can I use some features of a control without rendering it? Can I use some features of a control in a console app? NB: I tried to use a hidden WebBrowser control, but it didn't work. ...

Forms WeBrowser Document Ready event. How do I know when all Ajax calls are complete?

I am responding to the System.Windows.WebBrowser.DocumentComplete event in my application. However this event fires every time an ajax call completes on the page. I would like to know when the document is ready. Meaning when all calls out have returned. Any ideas? void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentComple...

convert wpf textbox to iwin32window (winform)

As the title describes, I want to convert System.Windows.Controls.Textbox to IWin32Window. I read http://stackoverflow.com/questions/315164/how-to-use-a-folderbrowserdialog-from-a-wpf-application but it only describes how to get handle of winform, not control on it. Thanks ...

How to make a form close when pressing the escape key?

Hi, I have a small form, which comes up when I press a button in a winforms app. I want to be able to close the form by pressing the escape key. How could I do this? I am not sure of the event to use (form_closing?)? Thanks ...