Questions tagged [user-controls]

A UserControl is a separate, reusable input control that allows a user to interact with an application. User controls can be buttons, checkboxes, input text boxes, mice, keyboards, etc.

A UserControl is a separate, reusable input control that allows a user to interact with an application. User controls can be buttons, checkboxes, input text boxes, mice, keyboards, etc.

User controls only exist on graphical systems or applications. For example, a HTTP service application does not contain user controls; its input is usually by means of a configuration file or a separate application providing it input.

10278 questions
32
votes
18 answers

Visual Studio 2010 Designer Error on Run

I am using using VS2010 and if I have a form open in designer mode and run my application the designer tab will no longer show the form designer but instead an error will be displayed (and it is only fixed by restarting the IDE) saying: "To…
Joel
  • 403
  • 1
  • 5
  • 5
32
votes
1 answer

How do I make my controls inside a UserControl private?

I have a user control with a ComboBox and a TextBox. Everything is working great except I noticed that from my user control's instance object, I can access those two controls. They shouldn't be accessible except via my own exposed properties.
ScottG
  • 10,711
  • 25
  • 82
  • 111
31
votes
4 answers

How to create a Circular Style ProgressBar

I need help on implementing a circular progress bar like this: How should I implement the Circle to fill by increasing Value property?
Jalal
  • 6,594
  • 9
  • 63
  • 100
31
votes
4 answers

WPF animation: binding to the "To" attribute of storyboard animation

I'm trying to create a button that behaves similarly to the "slide" button on the iPhone. I have an animation that adjusts the position and width of the button, but I want these values to be based on the text used in the control. Currently,…
user264621
30
votes
3 answers

Need guidance to start with Zend ACL

I am currently working on a site that requires ACL and as I am using Zend, it makes sense for me to make use of their ACL class but I have little to zero idea of how to do this. I have read the docs but it confused me further...basically all I want…
Udders
  • 6,914
  • 24
  • 102
  • 194
30
votes
7 answers

C# generics usercontrol

I would like to define the following control: public partial class ObjectSelectorControl : UserControl where T : class The problem is that the designer can't resolve this. Is there a workaround to this issue?
Toto
  • 7,491
  • 18
  • 50
  • 72
30
votes
5 answers

WPF: reverting brush to default/original

I'm a complete newbie at WPF. At the moment I'm making a usercontrol for form elements called "LabeledTextbox" which contains a label, a textbox and a textblock for errormessages. When the using code adds an errormessage, I want to put the border…
Thomas Stock
  • 10,927
  • 14
  • 62
  • 79
30
votes
1 answer

Adjusting spacing between usercontrols in a FlowLayoutPanel

I'm building a WinForms application Window (form), inside that I'm using a FlowLayoutPanel, with usercontrols added to this. Now I've been looking through the properties of both the FlowLayoutPanel and UserControl but can't seem to find anything to…
wonea
  • 4,783
  • 17
  • 86
  • 139
29
votes
3 answers

Adding children to UserControl

My task Create a UserControl which should be able to contain any visual child which is available in WPF, the children are displayed in a container which is a child of the UserControl. My Problem I can't manage to get the children displayed correctly…
Felix K.
  • 6,201
  • 2
  • 38
  • 71
29
votes
4 answers

WPF DataGrid - Why the extra column

I have a WPF app that uses DataGrid to display some data. When I run the program there is an additional column as shown here: Here is what it looks like when I design it in VS2010 I have turned off AutoGenerateColumns on the data grid and…
BrianKE
  • 4,035
  • 13
  • 65
  • 115
29
votes
3 answers

Text property in a UserControl in C#

I have a control with a inner TextBox. I want to make a direct relationship between the Text property of the UserControl and the Text property of the TextBox. The first thing I realized is that Text was not being displayed in the Properties of the…
yeyeyerman
  • 7,751
  • 7
  • 43
  • 52
29
votes
1 answer

How to enable design support in a custom control?

I'll try to explain what I'm after. I don't know the technical term for it, so here goes: Example 1: If I place a ListView on a Form and add some columns I am able, in Design-Time, to click-and-drag the columns to resize them. Example 2: Now, I…
Ted
  • 19,727
  • 35
  • 96
  • 154
29
votes
3 answers

WPF Window.Close() not triggering UserControl.Unloaded event

I have a Window that contains a custom UserControl. The UserControl needs to know when the Window containing it has been closed so that it can terminate a thread. My best guess as to how to accomplish this is to handle the UserControl's Unloaded…
Stephen
  • 3,515
  • 5
  • 27
  • 33
29
votes
2 answers

Why can't I use the Name attribute on UserControl in the same assembly?

When I created a WPF UserControl and tried to use it, I got the following compiler error: Because 'UserControl1' is implemented in the same assembly, you must set the x:Name attribute rather than the Name attribute. The message is clear on what to…
svick
  • 236,525
  • 50
  • 385
  • 514
29
votes
3 answers

How to create user define (new) event for user control in WPF ?one small example

I have one UserControl in which I am using a Canvas, and in that Canvas one Rectangle. I want to create a click event for that user control (Canvas and Rectangle) which I then want to use in the main window. The question is: I want to create a new…
Kiranaditya
  • 449
  • 1
  • 5
  • 15