winforms

How to deny to the ToolTip moving the Mouse?

I override the OnMouseMove method, like this: Private Shared OurToolTip As New ToolTip Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs) MyBase.OnMouseMove(e) OurToolTip.Show(e.Location.ToString(), Me, _ e.Location.X + 16, e.Location.Y, 2000) End Sub I trace this function (with a tracepoint). Whe...

Scrolling PictureBox in .NET?

I have a picturebox that is taking up 512x512. That is way to big, i can make it 256x1024 which is preferable but then how do i make it scrollable? ...

Make a textbox not blink?

I am trying to get a control i can click on, press any keys (except tab) and have it take in the input. I tried using this and had a problem with the arrow keys changing the focus. That question is here. The textbox seems to work but i dont like how it blinks. As in the line that shows where you next letter will be placed. How do i fix ...

Make a PictureBox not lose focus on Arrow Keys?

This question except i want to ask how do i make my picturebox not lose focus on keypress of the arrow keys. It gets focus when i overloaded it and set TabStop = true but the arrow keys are giving me problems. ...

Indicating a selected item in a listview

I have a ListView control in .NET Winforms containing filenames from a directory. When first displaying the control, I populate the listview, then programmatically select the first item in the list thusly: if (lvwFiles.Items.Count > 0) { ListViewItem firstItem = lvwFiles.Items[0]; firstItem.Selected = true; }...

Question about changing dialog box layout

Hey, I just got started designing dialog boxes and windows forms, and I had a basic question. When you use something like a windows installer, it has a next button, and when you click it the dialog completely changes layout in moving on to the next step. My question is, is this done by loading a completely new dialog box and getting rid...

Why all the event checks in the ButtonBase WndProc method, .Net WinForms

I'm creating a base class for a button that inherits from Control as opposed to ButtonBase. I'm using reflector to look at ButtonBase to make sure I don't overlook anything important and I'm puzzled with the contents of the WndProc method. There's checks in there for things like button up, click and capture changed, which as far as I can...

Invalidation/Paint problem with Control (WinForm)

I created a control which has a picturebox inside of it. In my main form i had a picturebox then replace it with said control. I now have a problem with .Invalidate(). I need it to update the picturebox inside of the control. I have an OnPaint overload. But doing Invalidate on the control doesnt call the function. How do i get Invalidate...

width of the dropdown arrow

So in winforms, every dropdown combobox has this little arrow thingy to the right that tells the user it's a dropdown, kinda like this: Now how do I figure out how wide that is in pixels? Reason is, I'm using ControlDrawToBitmap, this doesn't draw the text properly for the combo boxes, and I can redraw the contents, I just whack some ...

MouseWheel Event With Picturebox?

I want to hover over a picturebox (or all pics and the main form) and use the mousewheel to scroll. However i have no luck. I wrote pictureBox1.MouseWheel and check the delta. I set a breakpoint for when it != 0. So far no matter what i did i couldnt get anything to happen. I tried mousemove as well and that didnt work. However breaking ...

What good resources are available for an experienced ASP.NET developer to learn Windows Forms/WPF programming?

I am a ten-year veteran of ASP.NET and C# development and I'm moving into a position where I will be doing much more Windows Forms and WPF development. I have minimal experience with these technologies. Can you recommend any good books or resources that will help me ramp up on these technologies quickly? I'd like to find resources that...

DialogResult box default to No?

DialogResult result; result = MessageBox.Show(breakpl[0], "Move this to confige file?", MessageBoxButtons.YesNo); All I want is for when the box pops up to default to No, there is around 1000 No's and like 10 yes's. So I just want to be able to hit enter and cycle threw them. ...

How do I make the items in a ListView a different color?

I have a ListView full of ListViewItems. I want to emphasize some of them when a certain event fires, so I'm looking for a way to change the color of the listview to something other than black (red would be delightful). Is it possible to dynamically change the color of the items in the default winforms ListView? If no, is there some e...

Populating PictureBoxes with webimages via SQL fields.

I have a potential of up to 4 images per database row/entry and I am querying on Gridview_currentRowChanged. The issue was how to clear the picturebox(s) before loading the next row. private void radGridView1_CurrentRowChanged(object sender, Telerik.WinControls.UI.CurrentRowChangedEventArgs e) { panelImages.Contro...

How can I detect when Control.PreferredSize changes?

I'm using Control.PreferredSize in order to determine what the ScrollableControl.AutoScrollMinSize should be for a Form. This will need to be set whenever the control's PreferredSize property changes, but there doesn't appear to be a Control.PreferredSizeChanged event. Is there a way to detect when this property changes (possibly using C...

Why does System.Windows.Forms.HtmlDocument require full trust?

The HtmlDocument class has the following attribute: [PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")] public sealed class HtmlDocument Why? Can I override this somehow? Or would i need to reflect the source and recompile? ...

How to make an single instance form

I have a mdicontainer form that summons forms. My problem is when the a user clicks again the menu for that form, it also make another instance of it. What I did is declare a public class with a public variable on it ex: Boolean isFormOneOpen = false. Then every time formOne opens, it checks first the global variable I declared a while...

Controlling a C# Winforms GUI with IronPython

So I made a Winforms GUI in Visual Studio using C#, but for the project I am working on I want the majority of the code to be written in Python. I am hoping to have the "engine" written in python (for portability), and then have the application interface be something I can swap out. I made the C# project compile to a .dll, and was able ...

How can I change resource files for a c# winform app, without changing the culture?

We have a winform app that has been in development for some time. It has serveral images and control colours that create a branded experience. We have a second customer who would like the same product, but with different branding. So we have lines of code in the control designer.cs files like: this.BackgroundImage = global::MyNameS...

Form AutoResize has controls cutting off even with Anchor set as appropriate

Some code I found online: Font = SystemFonts.MessageBoxFont; AutoScaleMode = AutoScaleMode.Font; InitializeComponent(); Here's the problem; I've got a TextBox in a GroupBox in one instance, and a ListBox in a Panel in another that have their bottom edge going up to where the form editor snaps to. But with the above code, their resize...