Can anybody identify what type of Windows Form control(s) the Select signature to edit, Choose default signature, and Edit Signature are in the Microsoft Outlook insert signature modal? I cannot figure out if it's a super-shruken panel, or if it's some other control I'm not finding?
2 Answers
They are not controls at all. Most of what you see on that dialog is what I call "pseudo controls", that is painted bits that look and operate as controls, but which do not have system windows. You can see this by using a Spy tool to find the (non-existent) system windows.
You can achieve this yourself with Graphics.DrawText and ControlPaint.DrawXXX, where XXX I'm not sure of. Maybe Border, or 3DBorder?
Here's a cheap and dirty example. I used the WinForms Label control because it was easy.
using System;
using System.Drawing;
using System.Windows.Forms;
public class Form1 : Form
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
public Form1()
{
ClientSize = new Size(400, 200);
Controls.Add(new LineLabel { Text = "Edit signature", Location = new Point(10, 10), Anchor = AnchorStyles.Left | AnchorStyles.Right, Width = 380 });
}
}
public class LineLabel : Label
{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
SizeF textSize = e.Graphics.MeasureString(this.Text, this.Font);
int leftWidth = (int)(textSize.Width + 2);
Rectangle bounds = new Rectangle(leftWidth, Height / 2 - 4, Bounds.Width - leftWidth, 2);
ControlPaint.DrawBorder(e.Graphics, bounds, Color.DarkGray, ButtonBorderStyle.Solid);
}
}

- 14,171
- 3
- 41
- 68
-
I do think it's a control of some kind as you can see from the underlined "c" in Select for example. It looks like it has the functionality of a groupBox, without the actual box. Of course, the underlining and focus capture can be acheived using the method you described, but it seems more work than what some native controls already offer. – Magnum Jan 29 '13 at 19:29
-
1Of course it's more work. Professional Windows GUI apps require more work than slapping a bunch of standard controls on a window. This is the norm for Office, an application that has seen many generations of GUI "improvements" all done with "pseudo controls". The ribbon is a classic example. That is a single control, not a bunch of individual controls. – Tergiver Jan 29 '13 at 19:31
-
@Magnum The reason this is done is mainly performance. System windows are expensive resources. But it's also done because getting rid of the system windows gives you more flexibility in how bits paint close to each other, or even overlap. – Tergiver Jan 29 '13 at 19:33
They are GroupBoxes, albeit looking a little modified in terms of their borders. If you would like to customize your own, you could do that for a WinForms groupbox (to some extent) but it will prove a LOT easier to go with a WPF Groupbox and read up on styling in Styling a GroupBox.
A must-read is also MSDN - How To Define a GroupBox Template.

- 1
- 1

- 5,097
- 3
- 39
- 55
-
I suspect they are group boxes, but I'm not entirely sure because I was unable to get the look of the form I'm developing to match. Where can I find themes for group box controls? – Magnum Jan 29 '13 at 19:20