Questions tagged [controls]

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

A control is an interface element that a computer user interacts with.
Common controls include:

  1. Window A rectangle that represents a "window" into a document, form, or design area.

  2. Text box A box in which to enter text or numbers.

  3. Button An equivalent to a push-button as found on mechanical or electronic instruments.

  4. Hyperlink Text with some kind of indicator (usually underlining and/or color) that indicates that clicking it will take one to another screen or page.

  5. Drop-down list A list of items from which to select. The list normally only displays items when a special button or indicator is clicked.

  6. List box A GUI widget that allows the user to select one or more items from a list contained within a static, multiple line text box.

  7. Combo box A combination of a drop-down list or list box and a single-line textbox, allowing the user to either type a value directly into the control or choose from the list of existing options.

  8. Check box A box which indicates an "on" or "off" state via a check mark ☑ or a cross ☒. Sometimes can appear in an intermediate state (shaded or with a dash) to indicate mixed status of multiple objects.

  9. Radio button A button, similar to a check-box, except that only one item in a group can be selected. Its name comes from the mechanical push-button group on a car radio receiver. Selecting a new item from the group's buttons also deselects the previously selected button.

  10. Cycle button A button that cycles its content through two or more values, thus enabling selection of one from a group of items.

  11. Datagrid A spreadsheet-like grid that allows numbers or text to be entered in rows and columns.

  12. Slider A bar that allows users to make adjustments to a value or process throughout a range of allowed values.

8394 questions
689
votes
13 answers

How do I capture SIGINT in Python?

I'm working on a python script that starts several processes and database connections. Every now and then I want to kill the script with a Ctrl+C signal, and I'd like to do some cleanup. In Perl I'd do this: $SIG{'INT'} = 'exit_gracefully'; sub…
James Thompson
  • 46,512
  • 18
  • 65
  • 82
297
votes
21 answers

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
  • 42,496
  • 57
  • 170
  • 221
211
votes
20 answers

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
  • 4,954
  • 14
  • 52
  • 67
195
votes
6 answers

How to make overlay control above all other controls?

I need to make a control appear above all other controls, so it will partially overlay them.
user626528
  • 13,999
  • 30
  • 78
  • 146
154
votes
16 answers

Where is the WPF Numeric UpDown control?

Getting into the first serious WPF project. It seems like there are a lot of basic controls flat out missing. Specifically, I am looking for the Numeric UpDown control. Was there an out of band release that I missed? Really don't feel like…
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
144
votes
12 answers

What is Dependency Injection and Inversion of Control in Spring Framework?

"Dependency Injection" and "Inversion of Control" are often mentioned as the primary advantages of using the Spring framework for developing Web frameworks Could anyone explain what it is in very simple terms with an example if possible?
Chillax
  • 4,418
  • 21
  • 56
  • 91
139
votes
28 answers

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)) I know I can iterate over all controls getting…
Luis
  • 1,840
  • 2
  • 14
  • 14
131
votes
4 answers

How do you make a WPF slider snap only to discrete integer positions?

All too often I want a WPF slider that behaves like the System.Windows.Forms.TrackBar of old. That is, I want a slider that goes from X to Y but only allows the user to move it in discrete integer positions. How does one do this in WPF since the…
cplotts
  • 13,941
  • 9
  • 55
  • 66
122
votes
8 answers

How to find controls in a repeater header or footer

I was wondering how one would find the controls in the HeaderTemplate or FooterTemplate of an Asp.Net Repeater control. I can access them on the ItemDataBound event, but I was wondering how to get them after (for example to retrieve a value of an…
mbillard
  • 38,386
  • 18
  • 74
  • 98
116
votes
11 answers

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 need the control to be able to hold content that…
Ryan
  • 1,621
  • 2
  • 13
  • 14
109
votes
4 answers

ASP.Net: Literal vs Label

I just wanted to hear some authorities on when and where you should use a LITERAL control over a LABEL. As I understand it, the difference is this: A LABEL can be styled via the tags that are added. I personally find the addition of
Chuck Le Butt
  • 47,570
  • 62
  • 203
  • 289
92
votes
10 answers

Is there any good Markdown Javascript library or control?

I want to build a site where the user can enter text and format it in Markdown. The reason I'd like a Javascript solution is because I want to display a live preview, just like on StackOverflow. My site is not targeted at developers, however, so an…
webmat
  • 58,466
  • 12
  • 54
  • 59
87
votes
22 answers

Professional jQuery based Combobox control?

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 result list would be great too. I'm working with…
splattne
  • 102,760
  • 52
  • 202
  • 249
87
votes
7 answers

Where can I find free WPF controls and control templates?

I am looking for some recommendations on good places to find libraries of controls/templates/styles for WPF. I know about the usual places like Infragistics, but it seems to me that there should be some kind of community effort by now to share nice,…
GEOCHET
  • 21,119
  • 15
  • 74
  • 98
86
votes
1 answer

How do you add a scrollbar to a Panel control with many controls in windows form application?

How do you add a scrollbar to a Panel control with many controls in windows form application?
Chetan
  • 1,517
  • 3
  • 17
  • 25
1
2 3
99 100