winforms

How to detect mouse click outside winform control in C#?

I was willing to generate an event as mouseclick event in winforms when the the form control is not active and save the position of mouse cursor where it was clicked on the windows ... ...

VB.NET default radio button selected inside a group box

I have a WinForms application (VS 2008, .NET 3.5) that has a form with two different group boxes, and inside of each group box are different sets of radio buttons. When I run the application, the first group box automatically has the first radio button in it already selected, and the second group box does not have a radio button selecte...

Making keyboard shortcut keys which can enable an inactive form or using keys for controlling a form when form is not selected?

I want to minimize my winform application and perform send button click commands through keyboard shortcuts while by winform is not in active mod or minimized ...

Implementation Advice: Binding a button (Click event) to a function, and to another Control too.

I am developing a small C#-winforms program, that has a feature allowing users to add buttons and different controls at run-time. The scenario i am facing is as follows: 1) User adds a button and sets its properties (through a Dialog). 2) User adds a another control (also sets its properties). 3) User chooses the button and choose...

Row/Column coloring for TableLayoutPanel (vs2008, winform)

Hello Experts, Can i add particular color for entire Row or Column in TableLayoutPanel ? How ? please provide sample code if any .. Thanks in adv. ...

Computes different result -Method PointToScreen For Geting The Desktop(Screen) Related Point Of The Control

I use the function PointToScreen to get the screen related point of the control it gives proper value if I use this function for the toolstrip which is top on the form, but if there is menustrip on the top of the form and then under the menustrip, toolstrip is there then the function does not give proper value of screen point for the con...

Adding and removing controls and memory usage in WindowsForm

I have a WindowsForm with a panel control which I use to display my UserControls. I add controls this way: private void AddControl(Control control) { panel.Controls.Clear(); control.Size = new Size(panel.Width - 1, panel.Height - 1); control.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles...

Overriding default property values in .Net, WinForms.

Let's say I create a class "Planet" that can be inherited. One of the purposes of inheriting is to create a template with different default property values. Eg: Public Sub New MyBase.New MyBase.ForeColor = Red MyBase.Name = "Mars" etc. End Sub Now, to stop the defaults serializing in the InitializeComponent method, the...

Windows Forms Opacity After Shown- C#

I am tryig to fade-in a windows form using c# but it doesnt seem to work after I have shown the form. Is it possible to change the forms opacity after Ive shown it? Code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using Sys...

C# Override CheckedListBox

i need to override the base CheckedListBox behaviour. it is possible to check and uncheck a CheckedListBox without any code attached to it. i need to disable this behaviour so that i can implement custom code. any ideas? thanks. . for example: if (ListenCheckedListBox.GetItemChecked(0)) { ListenCheckedListBox.SetItemChecked(0,...

Draw image on a form from a separate thread

Hi, I am currently working on a Windows.Forms application. It's basically a simple motion detection problem. I have a button on a form, that when pressed launches a background worker that does the following : Fetch an image from disk Create a new bitmap, to be used as the buffer. Perform Motion Detection From the results of Motion Det...

drag into another process

I am trying to drag an item out into the explorer. The item should result in a file download, so I've used an example I've found on the web to download the file using a CustomDataObject that calls an event when he actually needs the stream, and then my application does the heavy lifting and performs the download. It's been working just f...

Allowing to Customize (Add/Remove) ListView Columns and Add/Edit the records (WinForm).

I have an Employee class ( Id,Name,Age) with few objects. I am showing all the records in "Employee View" form using ListView control and allowing user to Add/Edit/Delete these records. And have separate Form to Add a new record or to edit an existing one. (No database interaction, just have a List to persist these changes) Now, I want ...

User control in windows forms application

I have a simple user control with a text box and label in it. I created public properties to access the text in the textbox when I use the user control in another form. My problem is the property is returning null value when I call it in the form. Am i missing anything? My property is as follows:: public partial class UserControl1 :...

ComboBox goes blank after data bound update, even though data updates successfully

Hello, I've got a problem with getting a ComboBox to operate as expected when data bound, and I am not sure where the problem is. In the code below, a ComboBox is created and given a data bound list of values, and is then data bound to the form. The idea is that the ComboBox should display the list of options, and when one is selected...

Insert unknown number of Images to the report at runtime using reportviewer

Hi all, I'm using reportviewer and I would like to add an unknown number of images to the report on runtime. The user should select some images (in another place) and those images should be displayed in the report one after the other. Do you have any idea how to do that using reportviewer? thanks, Ofir ...

Taking this strategy while developing .net win-based application : "get a new connection object, use it, close and dispose it each time you need", How to handle connection string within the application?

As all we know, Connection string is a very important info.... So taking this strategy while developing .net win-based application : "get a new connection object, use it, close and dispose it each time you need", How to handle connection string within the application? ...

.NET Compact Framework config files.

Hello! I'm developing a Windows Mobile 5.0 or above WinForm application using .NET Compact Framework 2.0 SP2 and C#. I need to use a config file to store a Web Service's URL and other information encrypted. I've read something about Mobile Configuration Application Block from Mobile Client Software Factory. Can I use this? Is there a...

Good way to add context-sensitive help to an existing Windows Forms application?

Hi, I have to add database-driven tooltips to an existing WinForms App, big one. C# and .NET 3.5 I'd like to avoid having to drop new controls for this, and the user has to be able to edit the help tooltips. My best guess is to wrap the existing controls in a new type that contains new properties, so that I can assign a new property l...

get the title of the active website in a WinForms webbrowser class C#

i would like to know how to find out what the current document title is of the webpage i have my browser navigate to, is this possible or will i need to open a second web request, and parse the html for a title ...