Skip to main content

Questions tagged [controls]

Use this tag for programming scenarios related to controls (interactive elements of the user interface).

302 votes
22 answers
407k views

How can I find WPF controls by name or type?

I need to search a WPF control hierarchy for controls that match a given name or type. How can I do this?
alex2k8's user avatar
  • 43k
140 votes
28 answers
244k views

How to get ALL child controls of a Windows Forms form of a specific type (Button/Textbox)?

I need to get all controls on a form that are of type x. I'm pretty sure I saw that code once in the past that used something like this: dim ctrls() as Control ctrls = Me.Controls(GetType(TextBox)) ...
Luis's user avatar
  • 1,870
75 votes
14 answers
260k views

Get a Windows Forms control by name in C#

I have a ToolStripMenuItem called myMenu. How can I access this like so: /* Normally, I would do: */ this.myMenu... etc. /* But how do I access it like this: */ String name = myMenu; this.name... ...
user avatar
22 votes
7 answers
64k views

How to add events to Controls created at runtime in Excel with VBA

I would like to add a Control and an associated event at runtime in Excel using VBA but I don't know how to add the events. I tried the code below and the Button is correctly created in my userform ...
Fred FLECHE's user avatar
48 votes
17 answers
179k views

Best way to access a control on another form in Windows Forms?

First off, this is a question about a desktop application using Windows Forms, not an ASP.NET question. I need to interact with controls on other forms. I am trying to access the controls by using, ...
Dylan Bennett's user avatar
16 votes
7 answers
132k views

How to access a form control for another form?

I have two Form classes, one of which has a ListBox. I need a setter for the SelectedIndex property of the ListBox, which I want to call from the second Form. At the moment I am doing the following: ...
wulfgarpro's user avatar
  • 6,876
15 votes
6 answers
84k views

How To Get Control Property by "String Name"?

i have been created buttons and textboxs by coding in next loop, the result 'T(x).Name = "text_1" 'T(x).Name = "text_2" 'T(x).Name = "text_3" '.... 'B(x).Name = "button_1" 'B(x).Name = "button_2" '...
user avatar
219 votes
20 answers
212k views

Word wrap for a label in Windows Forms

How can one get word wrap functionality for a Label for text which goes out of bounds?
Nagu's user avatar
  • 5,064
54 votes
1 answer
44k views

Why will <%= %> expressions as property values on a server-controls lead to a compile errors?

This question is a result of what i noticed while trying to answer another question. And now im curious to know why <asp:TextBox runat="server" Visible="<%= true %>" /> leads to a compile ...
Tom Jelen's user avatar
  • 2,559
11 votes
4 answers
67k views

Find a control in Windows Forms by name

I am working on an application which add objects (basically Windows Forms controls) at run time from an XML file. The application needs to access the objects that have been added. The objects are ...
Vinod Maurya's user avatar
  • 4,185
122 votes
10 answers
49k views

How to create a WPF UserControl with NAMED content

I have a set of controls with attached commands and logic that are constantly reused in the same way. I decided to create a user control that holds all the common controls and logic. However I also ...
Ryan's user avatar
  • 1,691
87 votes
22 answers
135k views

Professional jQuery based Combobox control? [closed]

Are there any professional Combobox controls (dropdown list with autosuggestion) based on the jQuery library? It should be able to handle large datasets and have some skinning options. A multi-column ...
splattne's user avatar
  • 104k
48 votes
15 answers
133k views

How to access Winform textbox control from another class?

I have a winform called Form1 and a textbox called textBox1 In the Form1 I can set the text by typing: textBox1.text = "change text"; Now I have created another class. How do I call textBox1 in ...
Psychocryo's user avatar
  • 2,153
30 votes
1 answer
26k views

Differences between Excel's Form Controls & ActiveX Controls

Why are there 2 types of controls available in Excel? (2 buttons, 2 combo boxes, 2 check box, etc...) What's the difference between Forms Controls and ActiveX Controls? Which one should I use? ...
ashleedawg's user avatar
  • 21.2k
8 votes
3 answers
13k views

How to dynamically create controls aligned to the top but after other aligned controls?

In this particular case I'm using PowerPDF library to dynamically build a PDF document, but the same applies for the general concept of dynamically aligning controls sequentially inside of a parent ...
Jerry Dodge's user avatar
  • 27.2k

15 30 50 per page
1
2 3 4 5
64