winforms

How to prevent a window from opening from another application?

Hi, I will prevent a window from iTunes to be opened. I googled a lot but can't find an iTunes library that allows me to control such things, so I think I must get back to basics and close it after it opens, but how? I think: Tick a timer every 500 ms Check if the window handle is opened Close it Is that possible? How can I recogni...

RichTechBox and justify alignment

Is any way to justify text in Windows Forms RichTextBox control? ...

Is there an easy way to do a Master Grid View that links to a Detail grid view?

I've been struggling with trying to get this to work. Does anybody know of a easy to follow tutorial that shows the Master/Detail grid view? Thanks. I'm a very novice programmer. I'm using Visual Studio 2008 with c#. ...

Windows Form and Html Link

Is possilbe to open up a link from a windows form app like so: System.Diagnostics.Process.Start('http://www.Stackoverflow.com'); But have the link open in the current ie7 or ie8 that is already open? Currently we have an that loads a page when the user loads some info. We need it to load the same tab. ...

How to get control under mouse cursor?

I have form with few buttons and I want to know what button is under cursor now. P.S. Maybe it's duplicate, but I can't find answer to this question. ...

How do I add functionality to a winforms program in C#?

I'm trying to make a winforms version of a program I originally wrote as a console app. Here's a picture of my current progress. I've made the text boxes and buttons (with a read-only textbox for output). I don't know how to actually make the buttons function. I want it to work the same as the console version did (ask for input w/ erro...

Cancelling Background Tasks in C#

When my C# application closes it sometimes gets caught in the cleanup routine. Specifically, a background worker is not closing. This is basically how I am attempting to close it: private void App_FormClosing(object sender, FormClosingEventArgs e) { backgroundWorker1.CancelAsync(); while (backgroundWorker1.IsBus...

Accounting System for Winforms / SQL Server applications

If you were going to write a vertical market C# / WinForms / SQL Server application and needed an accounting "engine" for it, what software package would you chose ? By vertical market, I mean the application is intended to solve a particular set of business problems, not be a generic accounting application. Thus the value add of the pr...

Timer Events, Increments, and Resets in C#

A timer is being used in my C# application to determine if an expected event has occured in a timely fassion. This is how I am currently attempting to do this: // At some point in the application where the triggering event has just occured. // Now, the expected event should happen within the next second. timeout = false; timer...

How can I get a smooth, flicker-free GUI for an app run via Remote Desktop?

I realize there are a ton of questions floating around the internet about reducing flicker in Windows Forms applications. After copious experimentation, I found that the solution in my particular case was quite straightforward: setting the Control.DoubleBuffered property to true for the controls that were exhibiting flicker. I accomplish...

How do I highlight Text in a Textbox in a C# Winforms program?

I have a C# Winforms program with multiple textboxes. I used the properties for each box to place text in them, explaining to the user what value goes in them. I want the text to highlight whenever a user selects that box. By either tabbing or mouse click. I won't have to do this if there's a way to display what value goes in the textbox...

Data bound custom control with updating data when changed

I have a question related to Data Binding If we have class A with some property for example “UserName” and text control T1 bound as follow : T1.DataBindings.Add("Text",A,"UserName",true,DataSourceUpdateMode.OnPropertyChanged); I.e. property will be updated when user edit text Now if instead of text box we have custom control C1 ...

TreeView owner draw glitch when selecting

I'm trying to add a few more icons to elements of a standard System.Windows.Forms.TreeView control. My plan was to only change the label area of the treeview control, but it shows a strange behaviour. If I click a node to select it, when the mouse button is depressed the background is draw correctly with the highlight color. However, th...

How do I receive input to store as a string in a winforms project in C#?

I'm working on a program that asks for input, then calculates and posts the output. I managed to do it on a console application, but I don't know how to store input from a textbox. The input has to be positive integers, with an error message in place if anything invalid is input (to prevent crashing). I plan to have use a button to tr...

Why can't WIA see my scanner?

I'm trying to use WIA (Microsoft Windows Image Acquisition Library v2.0) to build a C# 3.5 WinForms app in VS2008 running on a Vista rig to aquire images from a scanner. I know there are plenty of SDKs out there that do this (Accusoft, ByteScout, Knowledge Lake, etc) but we wanted some control over the UI (or lack of) and the ability to...

when using "default proxy" where does the username/password come from?

Hi, The "WebClient" class (and ClickOnce also) can use default proxy settings (e.g. put in application.config), however: Where does the username / password come from? (I can't see a setting in the XML config - see below). Can the application be configured to manual prompt the user for the username/password http://msdn.microsoft.co...

How do I properly close a winforms application in C#?

I ran the .exe for my program from the debug folder. It worked, but when I closed it, I discovered that it was still listed on the processes list in the Task Manager. I figure I must've forgotten a step, since it's my first winforms program. ...

Fire event on Word-Wrap

Hi All Is there some way to find out when the text gets wrapped (WordWrap) inside a RichTextBox? I've dug around quite a bit but haven't found anything so far, will keep looking though... The reason I'm looking into this is because I need an event to fire whenever the RichTextBox wraps the text at the end of the line. Thank you all ...

C#: how do you refer to content in Program.cs in a form.cs?

I am trying to place a value (from an object) in a variable and place it in a textbox in a form. Here is the form code: public Form1(Deck mainDeck) { InitializeComponent(); int Val = mainDeck.ReturnCard(10); textBox1.Text = Val.ToString(); } mainDeck is an object in my Program.cs file The problem line...

Winforms control that works like ajax tag-completion

Heya, I want to create a winforms app where you can assign tags to an entity. ofc I want the customer to re-use existing tags a lot. That's why I want to show them the list of tags while they are typing (similar to intellisense in VS and the tags-dropdown even here in stackoverflow ;)) do you have any control(s) in mind that offers th...