winforms

Changing Theme(Color) of a panel according to Windows themes.

Hi, I want to change color of a panel according to current selected Windows theme. I have set the prop EnableVisStyles. It changes things like toolbar and Windows form's title bar. However the panel color remains same. Is there any way to achieve this?. Regards, Harsh Suman ...

Application.Run throws ArgumentException was unhandled

I have a condition in which I need to close the application and so I call this.Dispose() when I set a certian flag. At first I thought it was a problem of calling functions after I call this.Dispose() and so I moved the code to be the last thing called, but I still get a "ArgumentException was unhandled" "Parameter is not valid." on th...

Unique 'code' for each application deployment

We are developing a WinForm application that we want to deploy to certain users machine. We would like to uniquely identify each application installed with some sort of "code" that we can define before installing on their system. Right now we plan to put the unique code (that we type ourselves) in an xml or text file and have the appli...

MVC pattern in .NET: Can View call Exceptions in Model?

I'm using the MVC pattern in a .NET winform app. There are places in the Controller that can cause an exception. Rather than catching the exception and dislpaying a messagebox, which is a View responsibility, I do nothing in the Controller and let the View wrap that area in a try/catch. So far, there isn't anything that needs to be do...

WinForm Controls for .NET Compact Framework

I'm looking to invest in a UI control toolkit for a Compact Framework 3.5 project for Windows Mobile 5 and later. All I can find is the Resco MobileForms Toolkit (http://www.resco.net/developer/mobileformstoolkit/overview.aspx). I have two questions... Are there any other good WinForm control collections out there? Any experience with ...

Sort TreeView Automatically Upon Adding Nodes

Is there an easy way to add nodes to a WinForms .NET TreeView control where the new nodes being added are inserted at the correct index so the entire list of nodes is sorted alphabetically? Pretty much having the same result as TreeView.Sort(). I have a TreeView that continually grows to a couple hundred nodes. The user can view this Tr...

How to solve this focus problem with a dual monitor application?

We have an application that uses a dual monitor setup - User A will work with Monitor 1, and user B will work with Monitor 2 simultaneously. Monitor 2 is a touch screen device. Now, the problem is, when User A types something in his screen, if User B tries to do something, User A will end up in losing the focus from his window, which is...

multiple occurences of HandleCreated for a single control

I’m using control that needs to be register to asynchronous events. The events will be raised in the UI thread using the ISynchronizeInvoke interface implemented by WinForms controls I can’t register to the event at the constructor because it will allow calling the event handler before the control is fully created. during which calls to...

How to get the "real" value of the Visible property?

If you set the Visible property of a Windows Forms control to true, that property still returns false if any of the control's parent windows are hidden. Is there a way to get the true, underlying visibility flag of the control in case the parent window is hidden? ...

What are some database caching options for .Net?

I see on the web there are a lot of questions about caching ASP.Net, but not a lot of discussion on caching options for a Smart Client Application and their databases. What are the data caching options that are available for Smart Client Application on the .Net framework, and how are any of you using them? Edit Enterprise Framework ...

How to make Combobox in winforms readonly

I do not want the user to be able to change the value displayed in the combobox. I have been using Enabled = false; but it is very readable like when setting a Textbox.ReadOnly = true; Is there is a way of accomplishing this? Thanks, Kishore. ...

How do I avoid this blocking situation in .NET 3.0 / WinForms / SQLServer 2005?

Application 1 - Opens a SqlConnection and a SqlTransaction against a SQLServer 2005 database Inserts a record into Table1 Does not commit or roll-back the SqlTransaction - intentially keeping this alive to demonstrate / describe the problem Application 2 - Opens SqlConnection and a SqlTransaction against a SqlServer 2005 database...

problem with splash screen - C# - VS2005

Dear all, I have an application. First I display a splash screen, a form, and this splash would call another form. Problem: When the splash form is displayed, if I then open another application on the top of the splash, and then minimize this newly opened application window, the splash screen becomes white. How do I avoid this? I wa...

Two different windows forms in C#

I am new to C# and .NET programming. I want to design an application that opens up with a small login screen and when user presses the "Login" button, my program should close the login form and pass to a new form. How can I achieve this simple process? Thanks. ...

C# Splash Screen Problem

Dear All, I still have a problem with the splash screen. I don't want to use the property SC.TopMost=true. Now my application scenario is as follows: in progeram.cs: [STAThread] static void Main() { new SplashScreen(_tempAL);// where _tempAL is an arrayList Application.Run(new Form1(_tempAL)); } in ...

How to disable click sound in WebBrowser Control

I use Javascript to click a link in the webbrowser control. But I don't want to hear IE's "click" sound. Is there anyway to do this? P.S. I don't want to change system settings. I've seen this one(http://stackoverflow.com/questions/10456/howto-disable-webbrowser-click-sound-in-your-app-only) but Document.Write is not an option for ...

Webbrowser Undo/Redo question

I'm using a webbrowser component in VS 2008 with C#. How can I determine (with execCommands or something like that) if something is one the browser's undo/redo stack and how can I reset this stack (so that no undo redo steps are available anymore). Thanks! ...

Windows application

How the variables can be transferred between the Winforms? Example customer id Thanks ...

Creating An Insert Statement -- Windows application Vb.Net

I am doing windows appliction in vb.net. i have customer object contains save method. how do i generate insert query? I need to save the object in relational database (SQL server). I need to know which is the correct way of doing the insertion ie,. Inside the save method i have written the SQL statement to save the object. Is it the cor...

Passing data between forms

I have the following scenario I have a main form as MDI parent and MDI child form, the child form shows a new form (I called it mydialog). I want to access specific function in the MDI child form from mydialog so I tried to set the Owner property in the mydialog object but exception occured (circular reference exception) also the Parent...