winforms

Confirmation before closing

Hi I am using c# .net windows form application. I have a combo box and a text box and a close window button. Now If I make any change in the combo box or textbox and click on the close window button, it should prompt the user to save the modifications.. If no modification are made ( The user will just run the application, doesnt make any...

How to add a layer to a menuitem image

I have a menuitem with an image. I want to add half-transparent layer to that image. private void menuItem1_Paint(object sender, PaintEventArgs e) { using (SolidBrush brush = new SolidBrush(Color.FromArgb(128, SystemColors.ActiveCaption))) { e.Graphics.FillRectangle(brush, e.ClipRectangle); } ...

How to develop asp.net web service to create the web method which can take the parameter of type windows form control?

I am developing asp.net web service. I am developing this web service so that OPC ( OLE for process control) client application can use it. In this web service I am using the built-in functions provided by the namespaces using OPC, using OPCDA, using OPCDA.NET. I have also added the namespace using System.Windows.Forms in this web servi...

how to copy and paste form in the same application (using c# wins forms)

how to copy and paste form in the same application (using c# wins forms) ...

Animations in C#

How to Put the animation in C#. ...

Generating Color Gradient

I want to display to my user how many (percent wise) of their forms are compliant with the new standard. The way I want to let them know visually is the percent amount will be colored. It will be 0xFF0000 (pure red) for 0% and 0x00FF00 (pure green) at 100%. What is the best way to calculate the color for each step along the way? ...

What is a way to access .accdb files for reading and writing?

I have an Microsoft Access Database (.accdb) that stores information needed in an application. Is there a way to distribute my application with the access database without having the user have access installed or get the user to go and download and install the office runtime? The windows form application that uses the access database i...

Possible to use XP Visual Style in Vista/Win7?

It is possible to use the XP styles in Vista/Win7? If yes, is it possible to do it for a single control. I know I can turn off visual styles one control at a time using SetWindowTheme(). I know it is possible to turn off visual styles for the whole win forms app by removing the EnableVisualStyles call. The reason I ask is because in th...

BeginInvoke not invoking the target method in Release build

I have a method, which I wish to execute on the UI message pump and thus do the following: private void SomeMethod() { BeginInvoke(new MethodInvoker(MethodToInvoke)); } private void MethodToInvoke() { // This method contains code that I wish to execute on UI message pump. } Now, the above works just fine when I create a Debu...

How to catch key press on a form c# .net

Hi, I have a parent form that contains a lot of controls. What I am trying to do is filter all of the key presses for that form. The trouble is that if the focus is on one of the controls on the form then the parent form is not getting the key press event, so how do I capture the key down event? Thanks, R. ...

Which technology should I use to pop up a simple form in my add-in DLL?

I'm building an assembly that runs as an "add-on" to a vendor's Outlook add-in. When it is time for me to execute my "action", I have to put up a simple window with a few simple controls. The vendor's add-in provides me with the parent window's integer handle. I am able to put up a form pretty easily with WinForms by adding are refere...

Updating the icons in an ObjectListView

I'm using an TreeListView (a sub type of ObjectListView) in my current project. Each item in the list is given an icon, but the icon my vary depending on the state of the item. For example if the item is readonly I want to use an icon with a little lock symbol. When the items are first added to the TreeListView the icons are show correc...

Threading in C#

Hi All Just looking for something ultra simple. I need to spawn a method off to a new thread. I don't care when or how it ends. Can somebody please help me with this? Thank you ...

How to show controls hierarchy in Winform designer

Hi, One of our client has an old winform application that contains forms with a lot of controls on them. Some of those controls have a deep hierarchy and that make it to hard to select them in the designer. I would need to understand this hierarchy to make modification and correct some bugs, is there a tools, plugin or something to be ...

Databinding to object - howto update object/binding?

I got a textbox and use databinding to an object. This works fine, until I try to select a new product: product = new Product(id); textbox.DataBindings.Add("Text", product, "ProductName"); // After user action: product = new Product(newId); // <- the textbox isn't updated Do I have to clear the databinding and set it again after the ...

How to maintain my data like a session variable in .NET WinForms?

I am using .net Windows Forms i need to maintain some date to check the condition. so i have to maintain it up to user logged out? like session in ASP.NET how can i do this? (note it should not expires until the user logged out) ...

Recieve Events from the BOs

How to keep receiving events even with changed references? In a project I have the following relation between BO and GUI By e.g. G could represent a graphic with time lines, C a TimeLine curve, P - points of that curve and T the time that represents each point. Each GUI object is associated with the BO corresponding object. When T ch...

How to move the image from one point to another ?

i want to move the image from one point to another.what class(es) are needed for this ...

Showing a hidden form

How do i show a from that have been hidden using this.Hide(); I have tried MainMenuForm.Show(); and this just says i need an object ref. I then tried: MainMenuForm frmMainMenu = new MainMenuForm(); frmMainMenu.Show(); Which seems to show the appropriate form. But when you exit the app, it is still held in memory because it hasn'...

.NET C# MouseEnter listener on a Control WITH Scrollbar

As long as the mouse is over a specific control, we show some form. When the mouse leaves the control, we hide the control after a small timeout. This is standard hover behavior. However, when a control (for example a Treeview) has a scrollbar, and the mouse is ON or OVER the scrollbar, the events don't fire ... If we could get a refer...