winforms

How do I use a ValueConverter in with Databinding in Winforms

In WPF it is easy to use a ValueConverter to format values etc, (in our case convert some numbers into a different unit, e.g km to miles) I know it can be done in Winforms, but all my Googleing just brings up results for WPF and Silverlight. ...

C# WinForms Vertical Alignment for TextBox, etc.

I'm working on a project updating their WinForms application UI to be more consistent with sizes. TextBox and ComboBox controls have different heights by default, even with the same font. I've been able to resize the text boxes by turning off AutoSize, but the text still hugs the top of the control, leaving a gap below. Is there any...

Using IVMRWindowlessControl to display video in a Winforms Control and allow for full screen toggle

I've recently switched from using the IVideoWindow interface to IVMRWindowlessControl in my custom Winforms control to display video. The reason for this was to allow zoom capabilities on the video within the control. However in switching over, I've found that the FullScreen mode from IVideoWindow is not available and I am currently try...

WinForms: How do I simulate button behavior on an image?

I have an extension of the winforms TabControl, it's draws an X on each tab to allow the user to close the tab. Compare that to the standard: How can I simulate button look&feel on that image? What I mean is, when the user clicks down, it should visually indicate that. A button does this with an inset image. For bonus points, I'...

checkedlistbox vb.net multiExtended selection mode

Hi! First of all sorry because I don't know if this question is correct to put here. I have a little problem with a little VB.NET application that I am building. This is a winforms applications not WPF. I have a checkedlistbox with a few items and I want to allow user to select more than one using arrows keys or mouse clicks combined ...

Out of Memory error in Visual Studio 2008, opening WinForms designer. How to solve?

I'm using Visual Studio and while fiddling around with a custom control, I started to get an out of memory error. The stack trace is not helpful - it's just a bunch of frames doing Reflection and so on. How can I fix this? ...

Unable to remove master -> child subform links in microsoft access 2003

Hi, I am having an issue removing the master -> child link fields in an access subreport data form. I have tried every avenue to remove them, using the properties window of the subreport as well as the link wizard. I have also deleted the subreport from the database and then gone as far as re-importing the existing objects into a new ...

How to make tooltip move with mouse (winforms)

I want it to move when the mouse moves, and disappear when the pointer isn't over the label. This doesn't work: private void lblRevisionQuestion_MouseMove(object sender, MouseEventArgs e) { toolTip1.Show("test", this, PointToClient(MousePosition), Int32.MaxValue); } private void lblRevisionQuestion_MouseLeave(object sender, EventA...

Why aren't UI components refreshed when updated from background thread?

I have a winform with some buttons that are updated in an event handler. The event is fired from a background thread, then the appearance is set via the Invoke method. The buttons will just get enabled or disabled. Something will happen at unpredicable times, though: The button will not change appearance visually. When it should be ena...

Creating a image viewer window controll.

I am learning GDI+ and I am trying to make a display window with scroll bars (so I can only see part of the image at a time and I can scroll around it). I have read through the basics of GDI+ from several books but I have not found any good tutorials online or in books available to me about doing more advanced things like this. Any reco...

Why would you have multiple databindings to a WinForms control?

I'm trying to learn how to use WinForms databinding, but one thing that's confusing me is why you would "Add" a databinding rather then "Set" a databinding? For example consider the following code. TextBox1.DataBindings.Add("Text", ds,"Customers.CustomerID") As I understand it this line adds a databinding to TextBox1 that binds its Tex...

How can you determine if Control.Visible is set via property or if the value is inherited

I need to find a way to determine if the Visible property of a control is set via a property change or if is inheriting it value from its parent. Using the Reflector, I find that the functions this.GetVisibleCore() and this.GetState() are both internal methods so I cannot call them. The widgets themselves are created dynamically so I d...

WebBrowser control not navigating to links to "file://" protocol URIs

I am setting the DocumentText property to an HTML string that contains links like: <a href="file:///D:/dir/file.html">NewPage</a> The links are shown properly in the WebBrowser, but nothing happens when I click them. The Navigating, Navigated and DocumentComplete events do not fire - nothing seems to happen at all. AllowNavigation is ...

Winforms checkbox Databinding problem

Hello everybody! In a winforms application (VB, VS2008 SP1) i bound a checkbox field to a SQL Server 2005 BIT field. The databinding itself seems to work, there is this litte problem: user creates a new record and checks the checkbox, then the user decides to create a new record (without having saved the previous, so there are 2 new ...

CSharp Compiler and Windows.Forms

Hi All I've just created a little app that programmatically compiles code using the C# Compiler, and it works brilliantly. But, one thing that I need it to do is compile Windows.Forms code. Like, I can create a console app with it, but I can't create a GUI-based form. Here's the link that got me started: http://support.microsoft.com/kb...

WinForms: How to prevent textbox from handling alt key and losing focus?

I have this textbox I use to capture keyboard shortcuts for a preferences config. I use a low-level keyboard hook to capture keys and also prevent them from taking action, e.g. the Windows key, but the Alt key still comes through and makes my textbox lose focus. How can I block the Alt key, so the focus is kept unaltered at my textbox? ...

problem with converting simple code from Winform to silverlight app.

Hi. I have this code for window form application and I have been attempting to convert it to a Silverlight application but it does not work!. There is a Textbox and I attached KeyDown event handler to it. when the user press the arrow key ( left or right) while the focus on the textbox, it will write . or -. When it is window form i used...

Using web services over a proxy server Internet connection

I have a Windows form application that's consuming web services over https and is working perfectly. Do I have to make any arrangement in my code for the case when the user has an Internet connection through a proxy server? ...

Importing AutoCAD/Solidworks drawings/objects into winforms?

Has anybody done anything like that? I need to import 3d objects, done in either AutoCAD or Solidworks, and draw them into a windows form. I only need the object to be viewed in 3D and moved around - no manipulation required. I am assuming I will need 2 libraries at least, one for a very simple 3D engine, and one to actually get what I...

C# and Metadata File Errors

Hi All I've created my own little c# compiler using the tutorial on MSDN, and it's not working properly. I get a few errors, then I fix them, then I get new, different errors, then I fix them, etc etc. The latest error is really confusing me. --------------------------- --------------------------- Line number: 0, Error number: CS0006...