winforms

Show control on top in Visual Studio

If you have a button that i want to show on top? how do i do this, its now under a Picture box. ...

Control PointToClient() vs PointToScreen()

The MSDN does not provide, IMHO, a clear difference between Control.PointToScreen(link) and Control.PointToClient(link) methods. Is there somebody who could explain in a few simple words what is the difference between these methods. Especially is unclear for me the notion of "Client". I understand PointToScreen the real screen coordina...

Listview help..(Windows Forms)

Hello, How can I check if no items "At all" selected from listview? Thanks. ...

got error The variable <variable name> is either undeclared or was never assigned

Hi, i implement a big form in winforms c# with visual studio 2008. after working fine for a big portion of the dialog it start showing a lot of error masseges as in the title when i try to open the designer "The variable is either undeclared or was never assigned" i got this for a lot of controls that worked fine before. i think it h...

System.Windows.Forms.GroupBox text is missing

I am working with Visual Studio 2005 (C#) and in one of my windows forms I have a couple of textboxes. I have placed the textboxes inside instances of 'System.Windows.Forms.GroupBox' because I want to use the GroupBox member 'Text' to tell what the textboxes are for (it shows up as a label near the top left corner of the fine line that e...

Instantiate a Windows Forms control in WPF without default constructor

I am trying to host a custom Windows Forms control in WPF. My custom control does not have a public constructor, and it has a static Create() method which looks something like this: public abstract class MyCustomControl : UserControl { internal MyCustomControl(...) { } public static MyCustomControl Create(SomeEnum kind) { sw...

Are Windows Forms old tech?

It is time to write the GUI for my project, and I am wondering what technology to use. I did most of my .NET GUI development in .NET 1 & 2, so I know Windows Forms reasonably well. I am vaguely aware of WPF, but not yet attempted to "get into it". Are Windows Forms dead or dying? Is WPF a good technology to learn? Is it the future, ...

Handling text with embedded links in a windows form

I am trying to break out of vb into c# and needed a personal project to get some c# practice in to cement the syntax differences in my mind. I decided (for want of something better) to write a little twitter client, only something basic. I have designed a user control to contain the info about each tweet (the tweet itself, the user tha...

My checkedlistbox in C# shows the type of the object it is to display, but not the name of it...

I'm having an issue displaying an object in a checked list box in C#. I can add object fine, but when the object is displayed to the user, to the program outputs the checkbox selection as Salesform.order instead of invoking the tostring method in the order class like I want. This results in multiple orders displaying as the same thing: "...

Trouble binding a BindingList to ListBox.

In the app I'm working on, I need to maintain a list of Projects which are currently loaded, and display the names of each one in a ListBox (okay, multiple ListBoxes, but that's neither here nor there). class Project { public String Name; // Etc. etc... } I've got a BindingList object which contains all of the loaded Projects...

C# BindingNavigator Issue

I built a form to allow users to edit database records and all the data binding works and the saving works. However, when I add a new record to the underlying bindingSource with the "Add" button on the bindingNavigator and I try to navigate to the new record the "Next" and "Last" buttons on the navigator don't work, yet the "Count" was ...

How do I show a "Loading . . . please wait" message in Winforms for a long loading form?

I have a form that is very slow because there are many controls placed on the form. As a result the form takes a long time to loaded. How do I load the form first, then display it and while loading delay show another form which that have message like "Loading... please wait.?" ...

How to disable the line under tool strip in winform c#?

this line ? ...

What control should you databind a List<string> to?

I have an object with a simple property: public class obj { /* ... */ public List<string> EMails { get; set; } /* ... */ } All of the other properties on the object are simple strings or ints, and they databind well to textboxes/updowns and so forth, but I'm having trouble binding this List. The UI doesn't have any control...

Deadlock in WinForms that can be solved by right click on the taskbar

I encountered a strange problem with our Windows C# / .NET application. Actually it is a GUI application, my job is the included network component, encapsulated in an assembly. I do not know the code of the main/GUI application, I could contact it's developer though. Now the application's UI has buttons to "Start" and "Stop" the network...

How to clear a TextBox?

How to clear my TextBox after clicking SEND? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net.Sockets; using System.Threading; namespace SocketClient { public partial class SocketC...

"Caret Position" in VB.NET for syntax highlighting

Hi, I'm trying to make a TextBox with syntax highlighting (for (HTML/CSS) in VB.NET 2008. I figured that if I use RichTextBox.Find(), I can color specific text, but then I need to call RichTextBox.DeselectAll(). The problem is that the the cursor jumps to the beginning of the RTB. I'm using WinForms. Any ideas? ...

ShowWindow and messageloop

I'm using ShowWindow from user32.dll to show messenger style popups ( always on top, doesn't steal focus ), but I can't get them to respond. It seems that my new form is missing a messageloop, and therefore cannot draw it's controls or react to input. I've tried to create the form in a backgroundworker, but that doesn't seem to help (fo...

OwnerDraw ComboBox with VisualStyles

I have a ComboBox that I have set DrawMode = DrawMode.OwnerDrawFixed. Then I handle the OnDrawItem event and everything works perfectly. However, it looks very different from a standard ComboBox because mine doesn't seem to be rendered using VisualStyles. Do I need to do something to specifically enable VisualStyle rendering for my owner...

Set Statusbar Text on Mouse Hover - Works for controls but not MenuItems

I devised the following code for displaying a control's Tag property on mouseover. The code works fine for standard controls such as Labels and TextBoxes but I cannot get it to work for my MenuItems (more specifically ToolStripMenuItems). Could y'all please take a look at my code and tell me what I did wrong? Thanks in advance! public v...