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
3
votes
1 answer

c# TypeConverter and InstanceDescriptor pain

I made an example of UserControl and still (spent whole day) unable to fix my problem. I want UserControl to have a complex property, to see that property inside property grid at design-time, able to change it so on. Complex property is simple - its…
Alexander
  • 431
  • 2
  • 5
  • 19
3
votes
2 answers

How can I make the inner controls don't cover the main control's events?

I have a UserControlwhich contains some inner controls inside it. something like this: Now when I use it in my project, I want every point of my control raise the same click event if clicked, just like other controls. but the problem is: my handler…
Blazi
  • 991
  • 3
  • 9
  • 19
3
votes
2 answers

A panel switcher custom control for Winform in .net?

This is a .net winform UI question. In many cases, we want to design an UI such that, you have several options, and based on the option you choose, a different detail UI is setup for you. For example, imagine a user registration: based on the…
Steve
  • 4,935
  • 11
  • 56
  • 83
3
votes
2 answers

Adding a CheckChanged event handler to CheckBox inside a dynamically added UserControl

I have a UserControl that contains a CheckBox and a TextBox: On Page_Load I'm adding several of them dynamically them to a Panel on the page: //loop through the…
Ozzie Perez
  • 583
  • 2
  • 8
  • 17
3
votes
6 answers

access form from usercontrol

I have a user control, that needs to access variables and static classes on Form1.cs. I can't find a working example on google. Any hints please? Thanks! namespace WinApp1 { public partial class Form1 : Form { Public MyCustomClass myClass; //…
Kristian
  • 1,348
  • 4
  • 16
  • 39
3
votes
1 answer

UserControl - accessing textbox within UserControl within a web form

I am using c#.net I have different views within my webform, these all generally display different information except for three textboxes (arrival / seen / depart time). To try and cut down on code, I have created a UserControl which contains these…
ClareBear
  • 1,493
  • 6
  • 25
  • 47
3
votes
1 answer

recreation of dynamic controls in user control based in selection in another user control

About 5 months ago I was tasked with creating a new intranet site for my current employer as the old one is a nightmare to work with. The site uses multiple .NET languages (classic asp, VB, and C#) with multiple .NET frameworks (1.0, 2.0, 3.5, few…
3
votes
1 answer

Gridview PageIndexChanging event not firing

I hav a gridview inside a usercontrol
None
  • 5,582
  • 21
  • 85
  • 170
3
votes
2 answers

How to count the number of user controls that I have in a page?

I have a page that has 5 user controls. I want to do more with them, but for now, I just want to count them using the following method. void btnFormSave_Click(object sender, EventArgs e) { int i = 0; ControlCollection collection =…
Richard77
  • 20,343
  • 46
  • 150
  • 252
3
votes
0 answers

ControlTemplate doesn't find Resources anymore

I first created a UserControl. In the xaml I can reference StaticResources that are in the main Application's Resources. I then refactored this UserControl to a Control and via Themes/Generic.xaml, I apply a ControlTemplate (I needed this). But this…
jan
  • 1,581
  • 2
  • 19
  • 34
3
votes
1 answer

How do I create a banner panel in C#?

I want to create my own custom control that is basically a TableLayoutPanel with 3 rows and 1 column. The top and bottom rows will contain labels (banners) and the middle row is where I will add other controls. The problem is that when I try to…
bsh152s
  • 3,178
  • 6
  • 51
  • 77
3
votes
1 answer

Creating Custom Controls with generics

We wish to create a WinForms Custom Control (which is derived from a .net control) and be able to drag and drop it from the tool box in the designer view. However we are unable to this whenever we have a control with generics because when the…
Jonny
  • 2,787
  • 10
  • 40
  • 62
3
votes
2 answers

Usercontrol events don't fire in Httphandler

uitest.ascx usercontrol events do not fire, does anyone have a clue about it? business.Pages.Page page1 = new business.Pages.Page(); System.Web.UI.HtmlControls.HtmlForm form = new…
Cem
  • 889
  • 2
  • 10
  • 22
3
votes
4 answers

Adding/Docking controls in UserControl C# .NET

I am writing a UserControl which adds child controls programmatically. Currently I am adding new controls like so: this.Controls.Add(new Control() { Height = 16, Dock = DockStyle.Top }); The problem I am experiencing is that new controls are added…
Matthew Layton
  • 39,871
  • 52
  • 185
  • 313
3
votes
3 answers

How do you free system ram when creating and disposing user controls

I have a c# application that is composed of various screens which is each a respective user control. The application requires a lot of switching between the various screens and is also graphic intensive. Each control is disposed once the next…
user175480