winforms

Zooming the selected rectangle of an image

I am working on zooming selected rectangle of an image. But for some reason the selected area has not been displayed in the picture box. I do want only zoom the selected area. But the following code does not work properly. What could be the problem? Thanks for any help. private void Form1_MouseDown(object sender, System.Wind...

.NET Forms Wizard Control

In the old days using MFC I could turn a property sheet into a wizard style dialog very easily and reuse my dialog templates. I have a .NET form with a tab control that I would like to do the same with. Is there an easy way to do this in .NET without having two copies of my controls? ...

C# how to apply filter to dataGridView with a dataMember declared on its bindingSource

Hi, I'm having some issue getting a row filter on my dataGridView because the DataMember of the dataGridView is itself a member of the larger bindingSource List object that I am using as a datasource. (thats a mouthful, sorry). Heres some pseudo for my structure.... class DataDisplayObject { public string Value { get; set; } p...

Multidirectional Image Navigation control in .NET / Windows Forms

I have a Matrix of images like this: 1 2 3 4 5 6 7 8 9 10 1 x 3 4 5 x 7 x 9 10 x x x x x x 7 8 9 x …where "x" means no image. I'm looking for a flexible .NET component that will allow me to have a UI to browse the images and move in the four possible directions: Right, Left, Up and Down. Does anybody know of something like this? ...

How to show Internet Explorer's History in a control?

I just got a requirement to emmbed an IE control into a form, and the user wants to get access to all the browser histories. I think the history manager in IE will do this, so how can I emmbed the history manager into my control? Or can I read the history information, put it in a ListView and handle it myself? Thanks ...

memory handling in c# windows application

Hi, I've a windows forms application. When i try to run this application it is increasing mem Usage continuously. How can i control this? just my application contains only 10 to 15 database calls. Code from comment to answer (there's no context though): Label lbl = new Label(); lbl.Text = "my data label"; lblrss.Font = new System.Draw...

Comma Separated Value Files (Read/Write) - C#

Hey all, I've been very interested in CSV files for a few years now, but I never needed to use them until now, so I'm pretty new to this. I have an application that stores information about Controls that were created by the user at run-time. I plan on using CSV files to store this information which will be extracted at a later date by ...

How can I use RegEx to make sure a valid email is written in my TextBox>?

I'm a complete newbie to RegEx and I'm sure it'll be brilliant to use once I know how to use it. :P I have a couple of textBoxes and I was wondering if anyone could me acomplish what I need. In the EMail textbox, I'd like to make sure the user writes in a valid email. [email protected] Is there a way for RegEx to help me out? I'd also reall...

Make a label appear for 3 seconds, and then dissapear again.

How can I have a label saying: "Registry updates correctly" and then have it dissapear after about 2 seconds? I'm guessing by modifying the .Visible property, but I can't figure it out. ...

Programs as MDI Child windows

Hi Is there a way to use a program as a MDI child window. I am thinking of having one main MDI parent window which can have multipe child windows, some of which will be programs(.exe files) in there own right. Tim ...

global variable approach in C# Windows Forms app? (is public static class GlobalData the best)

Hi, I want to have some custom configuration (read in from file) available throughout my C# windows forms application. Is the concept of say: creating a static class, e.g. "public static class GlobalData" loading from from the "Load" action of the main form event How does this sound? Is this the best practice way to do it? ...

How to get system tray functionality WITHOUT using NotifyIcon.ContextMenu?

Hi, I'm trying to get my application to display a popup context menu when a user right-clicks on my notify icon in the system tray... but there's a twist. I'm aware that the NotifyIcon class I'm using to get the icon in the system tray has a ContextMenu property. I don't want to use that to get a right-click popup menu, because it ALWA...

How to programmatically set cell value in DataGridView?

I have a DataGridView. Some of the cells receive their data from a serial port: I want to shove the data into the cell, and have it update the underlying bound object. I'm trying something like this: SetValueFromSerial (decimal newValue) { dataGridView.CurrentCell.Value = newValue; } using a string doesn't help: dataGridView...

Is it possible to load 2 file explorer windows in 1 form?

I would like to have a form that has 2 windows file explorer(explorer.exe) views. I know I could code a file browser in a few days, but I much rather just use instances of explorer. I dont need to re-invent the wheel, just two windows connected by a form. Is this possible in C#? ...

C#: Overriding OnPaint on ProgressBar not working?

Was thinking it should be pretty easy to create a ProgressBar that drew some text upon itself. However, I am not quite sure what is happening here... I added the following two overrides: protected override void OnPaintBackground(PaintEventArgs pevent) { base.OnPaintBackground(pevent); var flags = TextFormatFlags...

How to program asynchronous Windows Forms Applications?

I'm writting a Windows Forms application in C# that performs a lot of long-running procedures. I need to program the application so that the GUI doesn't lock. What is the best way to program it? I know how to use the following: BeginInvoke/EndInvoke Calling Application.DoEvents() repeatedly (probably not a good idea) BackgroundWorker ...

which winforms control/approach to bind to a List<> collection of custom objects?

Hi, I'm new to winforms (using C#) and would appreciated a headsup re the winforms control/approach to use to quickly provide visual editing of my List collection. So the in-memory collection I have is below. So my requirements were basically to: provide a means on my winform form, to allow add/view/edit of the List of ConfigFileDTO...

windows forms splash screen to main form - infinite loop

I have seen some good recommendations here before about using the VisualBasic assemblies (WindowsFormsApplicationBase) to nicely create a splash screen followed by the main form. I have an app that I want to put into some sort of loop whereby I want to repeat this cycle. For example during the splash screen I login to an available serve...

Any guildelines for coding Winforms applications, especially UI in C#/.net?

I wonder whether there are some guidelines that I can use for coding Winform applications in .net, preferably in C#? For example, when I initialize data bindings for a form, shall I put the initialization code in the loading event of the form or in the constructor of the form? What is the correct way of adding controls/components from c...

Convert string to font & Color

Can somebody please help me with a regex (or something else), I'm really struggling to get this done and can't find anything anywhere that helps me to finish it. I have a program where the user places some controls on a form. and when they click the save button it goes through all controls on the form and saves their details to a text f...