winforms

Implement Word Spell check in Windows Form App

I have an In-house windows form app that I would like to use Spell Checking in. Everyone has Office 2007 installed so I shouldn't have an issue there but I am having trouble getting this to fully work. Here is what I have: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Word = Microsoft.Offi...

Switching a sizeable form between toolbar visible and not visible. VS.Net

I have a sizeable form that can be toggled between showing the toolbar and not. To hide the toolbar, I set ControlBox = False, and Text = "". If I toggle from toolbar visible to toolbar not visible, the form DialogResult is set to cancelled. Looking at the code at the Form's OnTextChanged method in reflector, I can see that the form's ...

When to use MVP in Windows Forms .net application?

I am familiar with MVC/MVP though my question is simple, I'm about to program a simple Instant Messaging software when the engine and communication part is an open API. so my software will have about 3 forms, a splash screen with login details, the options form and a main form with all the functionality like: Friends List, Send message, ...

Display new form based on GridView data

Hi All, I have a GridView, radGvA133s, on my main form, MainForm. I would like to be able to double-click on a row of the GridView and have that open up a new form, A133Form, to allow editing of the selected row. Here is the double-click code: private void radGvA133s_DoubleClick(object sender, EventArgs e) { A133 oA13...

How to bind a WinForm textbox to update on TextChanged instead of LostFocus

I am binding a textbox to a property on an object, and would like the property to be updated on the TextChanged event and not the default LostFocus event. How would this be done? It would be nice if there was a property on the Binding object to designate which event should be used. ...

Trigger not launched from interface

Hello: I have a table with an after update trigger in SQL 2005. If I update directly with SQL QUERY the trigger runs ok. This table is connected using a dataset and tableadapter to a DXDBGrid (Dev. Express). If the user updates the grid, the underlying data is updated, but the trigger is not launched. I've a PK on table, auto-generat...

Threading with Windows Forms

I've written a Windows Forms application in C#. When I run a separate thread containing a method that toggles the invisibility of a panel on my form, it works the first time but not the second. Why and how can I fix it? ...

WinForms: force GUI update from UI Thread

In WinForms, how do I force an immediate UI update from UI thread? What I'm doing is roughly: label.Text = "Please Wait..." try { SomewhatLongRunningOperation(); } catch(Exception e) { label.Text = "Error: " + e.Message; return; } label.Text = "Success!"; Label text does not get set to "Please Wait..." before the opera...

C#: Good way of finding the next and previous sibling control

What is a good way of finding the next and previous siblings of a control? So for example if you have a panel with a number of buttons, textboxes, etc in it. Somewhere among those you have a user control which consists of a textbox and a button. When the button is clicked you for example want to find the name of the control that comes a...

C# when in Control's life cycle is Site (ISite) not null ?

Hi! I have a form MyForm : System.Windows.Forms.Form {} and I need to call Site.GetService(..) before user starts using this form. But it's null in constructor and all loading events I've tried to override. When is the Site not null, please? ...

Implementing Drag and Drop Functionality WebBrowser Control Winforms C#

I need to capture drag and Drop Events of WebBrowser Control in WinForm C#. Is there any way ? ...

VC# Multiple Mouse

How can i seperately get x,y coordinates and events of multiple mouse attached to the system and identify the mouse uniquely in winforms. What about muliple keyboards as well NOTE: i am not taking about multiple cursors... all i am taking about is some hook which tells me that i have mouse 1 & moise 2 attached to the system and will ...

C#: How to swap the position of two winform controls

Let's say you have two Controls, Alice and Bob, and you want to swap their position. By that I mean that after the swap: If they are living in the same ControlCollection, Alice should have the index of Bob and vice versa. If in different ControlCollections, Alice should have the same index as Bob, but be in Bobs ControlCollection and v...

How to Invoke Shortcuts Keys in the UI Automation? / .NET

I'm writing program to automate win32 form. I'm using Microsoft UI Automation library. I don't know how I can get and invoke predifined shortcuts key on that form. Now I simply get AutomationElement of the MenuItem and invoke click on that elemnt. Any solutions? Does anybody do this? ...

Tag contents adding to XML file in c# window application

i have an xml file sitemap.xml as shown below ..i need to add one more tag here after <Name> tag..Means After <Name>test</Name> tag here i need to add destination tag like <Destination>NY</Destination> .Can we add contents to xml through a textbox by pressing a button control without manually doing this is xml file sitemap.xml <?xm...

how to Control "Windows XP Volume Control" with VC#

i want to write know how to control "Windows XP Volume Control" (volume, wave, cd sound ) using VC# Winforms. and what ever the method will it also work for windows Vista is compile my code with a third party software to make EXE code instead of ClR code that is dependent on .NET. ...

listbox control in window application

in my window application i have list box. when i select any of the item in listbox i have to display in text box that particular item please help me ...

DataGridView with row-specific DataGridViewComboBoxColumn contents

So I have something like the following data structure (constructors omitted) class Child { public string Name { get; set; } public int Age { get; set; } } class Parent { public string Name { get; set; } public List <Child> Children { get; private set; } // never null; list never empty public Child FavoriteChild {...

Where to unsubscribe events in a WinForms UserControl

Where would you unsubscribe events in a UserControl? I subscribe to it in the Load event, like I have done in forms. And in forms I would usually unsubscribe in the Closing event, but I can't find anything similar in the UserControl... ...

Get Byte Offset of selected Word in WebBrowser Control

How to fetch Byte Offset of selected word in WebBrowser Control. ...