winforms

Problem with NumericUpDown type

When i do something like this: public static void BindData<T>(this System.Windows.Forms.Control.ControlCollection controls, T bind) { foreach (Control control in controls) { if (control.GetType() == typeof(System.Windows.Forms.TextBox) || control.GetType().IsSubclassOf(typeof(System.Windows.Forms.TextBox)...

Custom nested container control

I'm writing a custom control which consists of a FlowLayoutPanel nested in a normal Panel. The FlowLayoutPanel is internal to the class, and shouldn't be able to be viewed by the designer (unlike a Tab, which has its individual properties exposed.) Any control the designer adds to the Panel should instead be added to the FlowLayoutPanel....

Using ProgressBar as a wait bar - how to avoid freezes?

I'm creating a custom charting control and I would like to have the possibility of displaying some sort of wait bar while other commands are running (i.e. chart is being created). I'm using ProgressBar (System.Windows.Forms.ProgressBar in marquee mode) as a part of this control. I do not need to update the state of the progress bar, I ...

Scrolling panel causes controls to appear halfway down panel.

I've got a strange problem here. I have a winforms panel which programatically has labels and a usercontrol (which is capable of collapsing/expanding) added. The user defined controls are in groups which is where the labels come in to it. Due to the size and number of controls I have set the panel to support scrolling. So far so good...

In .NET WinForms, how do I put controls in the window border like IE8, WMP, Win Explorer etc.?

Using WPF, how do I put controls in the window border, like the address bar of IE8, the play controls in Windows Media Player, and the address bar of Win. Explorer? ...

GUI Design: Hide/Show controls at run time

what is the best idea/technique to do this and I prefer not to create all these at run time and not using the Tabs control: let's say we have three radio buttons on the form and based on the user selection we want to show him different GUI stuff ( checkbox, listbox, etc ... ) on the same form. How to do that? ...

Why is this gap showing up in my ListView?

I have a C# WinForm application where I am using a ListView to show what files have been uploaded to my database. I use the same code each time, calling LoadFileAttachments() when the form loads, and again any time I refresh the list, or add or remove additional attachments from the database. (This part works great) Where I am having an...

WinForms Gradient (Image or By Code) - OnDraw Event

Ok so im starting to get stuck into my design and get the style right. My Theme is using a kryptonForm style GUI but kyryptonForms do not not have a pre designed ListView, so im having to build this myself My Application is a messenger system based on XMPP/Jabber so you can guess how i would like my contact list to be designed. i have...

Disable user resize a form after specific size.

I would like to let users resize my form but when they reach a specific size to disable this ability to make it smaller window than i want. Any suggestions? ...

what would be the max event updates/sec to a C# WPF app I should allow

I'm going to have quite a few event updates to a C# WPF GUI coming through from a class library I have - I'm thinking I should probably throttle the number of events that can get through per second, so: 1) Any rule of thumb re how many UI changes update events one should allow through per second? (e.g 10 per seconds say) - in my case th...

Auto resize the panels of SplitContainer

in a splitcontainer if I write splitcontainer1.panel1.visible = false; it does not cause the panel2 to fill all the space of the splitcontainer but this is what I actually need. can you please help me how to achieve this? thanks. ...

Show/Hide for cells of TableLayout

C# Winforms: My tableLayout has only one column but it has three rows. I want to be able to show/hide the rows. I did a google search and found this, it works perfect for Hiding the row But what to do for showing it again? setting the height to a hard coded number? Not a good idea ... tableLayoutPanel1.RowStyles[0].SizeType = Size...

Flickering in a Windows Forms app

I have an app that has a ton of controls on it. And it has a massive amount of flicker, particularly on startup. I applied the fix to it. protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.ExStyle |= 0x02000000; // WS_EX_COMPOSITED ...

Is it possible to nest a listview inside another one?

Using a C# 3.5 Winforms - Is it possible to nest one listview inside another? The idea is to a list of lists - The higher level list would be groupings and the lower level list would be the details. UPDATE: Nesting does not appear to be possible. However using a FlowLayoutPanel I can add many listview controls into it and the panel...

Problem Moving an Image directory

I have a small application that saves images from a digital camera into disk. I generate a small bitmap preview of each folder and that is blocking me from moving the images. I tried to clear the controls containing the open images: imageList2.Dispose(); listView1.Items.Clear(); listView1.Clear(); listView1.Dispose(); nodeDirInfo.Mov...

Putting IME in a custom text box, derived from Control

I have created my own single-line textbox control in C# .net 3.5 I've written this completely from scratch, including my own selection code, scrolling, copy/paste etc. It can even select left-to-right text, not that I'd ever use that... The problem I'm having is with IME (input method editor) integration. The IME does work to an extent...

C# Program Settings and Localizing

So I'm starting my first actual Program in C# now, and just before I dig into the actual functions, I'm asking myself about localization of a Program. I thought, a .resx is nice for the language-variables to store. But how can I get that into the settings? I see there is a .settings file, where I can assign Settings for the program, but...

How to prevent validating from being fired when I click X on the form

This is a winform C# question. I have a textbox with a validating event listener to validate the content of the textbox. Say, the textbox doesn't accept negative values. I only listen to validating event so by default, the textbox's AutoValidate property is EnablePreventFocusChange, which is totally fine for me. The problem is, when I c...

getting back default button properties C# - Windows forms

In my Form1 I am trying to change around 50 button images as follows: button1.Image = new Bitmap("C:\\x.jpg"); button2.Image = new Bitmap("C:\\y.jpg"); button3.Image = new Bitmap("C:\\z.jpg"); ..... etc.... on another event I want all the 50 buttons to have their default ...

How to make datagridview auto save record when leaving a row

I have datagridview I want to automatically save each record after editing this record. ...