winforms

How to fix weird scrolling/alignment behavior when using keyboard in MenuStrip?

I started noticing strange behavior when navigating the main toolbar of my Winforms application, and I don't know how to fix it. When I initially open the dropdown of the File menu, it looks like this: I begin to scroll down each item with the arrow keys, and everything is fine until I reach "Exit". As soon as I hit the down arrow key...

Winform not scrolling when drawing objects on it

Hello All, C#3.0,.net framework 3.5 I am drawing ( using the draw method in the graphics class) a lot of solid rectangles on a windows form vertically. The form starts at 500 x 500 px and the rectangles are only drawn at runtime after data is downloaded from the net -and the number of rectangles depends on the download so I do not know...

C# - How to make text/labels smooth?

Hello. Does anyone know how to make labels, or text, smoother? At the moment they look quite jagged. As I want to make the label dynamic, I can't just insert the text from Photoshop. Any idea? Thanks. ...

I Clean Solution'd my Winform App and now it's broken...

I have a Winform App that uses a 3rd Party Library of Controls, DevExpress. I also created a bunch of Controls myself, extending those controls. Everything has been working fine when all of a sudden I opened VS today and on the Design Page all my extended controls were missing. I then tried rebuilding to no avail. Then I tried Cleani...

passing datagrid values as a parameter.

I have a datagridview that I would like all values on a specific row passed to a new form. I can extract the values, but how would you recommend passing these into the new form (each will be assigned to a specific textbox)? ...

Problems with FlowLayoutPanel inside Panel with AutoSize

I have the following controls hierarchy: Form Panel (AutoSize = true, AutoSizeMode = GrowAndShrink, Dock = Top) FlowLayoutPanel (AutoSize = true, AutoSizeMode = GrowAndShrink, Dock = Top) Control1, Control2, Control3, Control4, ... FlowLayoutPanel (AutoSize = true, AutoSizeMode = GrowAndShrink, Dock = Top) Control1...

Intercept paste event on HtmlEditor WinForms

Hi I'm using a HtmlEditor control inside a Windows Form. I got the control from this page: http://windowsclient.net/articles/htmleditor.aspx I want to extend the controls functionality by allowing the user to paste images from the clipboard. Right now you can paste plain and formatted text, but when trying to paste an image it does n...

How can I draw over a panel in C#?

Hey, I need to do my drawing over a panel in C# but without placing my drawing code inside "panel1_Paint", how can I do that ?? BTW, I'm using WinForms. Update : I forgot to make something clear, I need not to place my drawing code inside paint handler, because I need to start drawing depending on buttons' events. ...

Mouse Capture and Selection

I have a control, that moves around alot of different controls inside of it in the form of a grid. So basically, none of the container control is shown at any point. But i do have capture of all the mousedown and mousemove events of the controls inside. What id like to do, is create an effect alot like the desktop of a windows computer, ...

How to fix the flickering in User controls.

In my application i am constantly moving from one control to another. I have created no. of user controls, but during navigation my controls gets flicker. it takes 1 or 2 sec to update. I tried to set this SetStyle(ControlStyles.OptimizedDoubleBuffer, true); or SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingI...

Implementing maxmize a control to occupy the whole client area in winforms?

I just can't give a good title to my question, sorry. I have 3x3 picture boxes on a form, what I want to do is when the user double click on one of the 9 picture box, I want to make the clicked picture box take the whole area, kind like a zoom effect, any idea how to implement this effect? ...

Mono Winforms Mac OS X Replacement for WebBrowser

I'm one step away from having my Windows .Net application working on Mac OS X, and the last thing I need to figure out is the WebBrowser control. I need to display a webpage and not much more with winforms but haven't been able to find any examples or information on how I can replace the WebBrowser control on Mac OS X Has anyone alrea...

If I replace an image in a PictureBox control, should I dispose the original image first? .Net Winforms.

Following on from my question here http://stackoverflow.com/questions/2548664/long-overdue-for-me-question-about-disposing-managed-objects-in-net-vb-net , If I replace an image in a picture box, should I dispose the original image first? Or, what about this situation: Dim bm As New Bitmap(32,32) bm = New Bitmap(32,32) bm = New Bi...

User controls do not properly fit on the screen

Hi, My application has several controls. Like in one screen has TreeView on left side, GridView with paging in the middle and 4 buttons at right side. The controls properly appear when the form is in a maximized state, but if I minimize it the controls do not properly fit on the screen. I tried with different different tricks like tab...

Change the style of WinForm border?

Is it possible to change the style of a WinForm border? I know that if the border is removed, it takes away the functionality to resize the program. Therefore is there a way to change the style of it? At the moment, I've removed the text from the border, set the "FormBorderStyle" to "SizableToolWindow" and set the "ControlBox" to false. ...

Tab Page launching a timer

I have a project that uses a System.Timers.Timer to update the position of motors. I am adding 3 more motors and would like to control each of them the same way as the first. I tried moving my controls to a Tab Control but my update timers are not triggering. I made the UpdateTimer.SynchronizingObject = TheMainForm; Because if I t...

Adding scrollbars to UserControl

I am trying to add vertical and horizontal scrollbars to my UserControl with the HorizontalScroll and VerticalScroll properties, but I am having extreme issues. My problem arises when I drag or manipulate the scroll box on the bar. When I let it go, it simply jumps back to the start position! I know of the AutoScroll property, but I do ...

Releasing WinForm Program Updates

Hello, Another quick question. I'd like to release some updates for a WinForm program, but to date I have simply released an all-new compile. People have to un-install the old version and install the new version. EDIT: I'm using an auto-generated InstalWizard. It preserves my file strucutre and places the [PrimaryProgramOutput] in ...

Detect when application becomes active

In MDI application which event can the child Form class use to detect when the application becomes active? I tried Form.Acivated event but it occurs only when the form is activated and doesn't when the application gets focus. ...

Winforms role based security limitations

I'm implementing role based security using Microsoft's membership and role provider. The theoretical problem I'm having is that you implement a specific role on a method such as: [PrincipalPermissionAttribute(SecurityAction.Demand, Role="Supervisor")] private void someMethod() {} What if at some point down the road, I don't want Supe...