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
15
votes
2 answers

Replacing a component class in delphi

I know I've seen an example somewhere of a hack to define a custom version of an existing VCL component, like TButton or TEdit, with the same class name and do something to make it so that the DFM streamer will instantiate your version instead of…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
15
votes
6 answers

Is there any way to get all the controls on a container control?

I've got a form with a bunch of controls on it, and I wanted to iterate through all the controls on a certain panel and enable/disable them. I tried this: var component: TComponent; begin for component in myPanel do (component as…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
15
votes
3 answers

Programmatically Creating Controls in Cocoa

According to Cocoa Programming for Mac OS X, 3rd Edition, on page 245 (chapter 17), you will usually create views in Interface Builder. However, it is possible to create them in code, a la: NSView *superview = [window contentView]; NSRect frame =…
John Rudy
  • 37,282
  • 14
  • 64
  • 100
15
votes
6 answers

Controlling simple relay switch via USB

I'm looking to control a mains powered light from a simple relay switch connected via USB to the computer. The relay switch isn't even a USB device, it's just a simple switch that requires the USB voltage to turn it on. When the voltage drops below…
Matt
  • 11,157
  • 26
  • 81
  • 110
15
votes
5 answers

WinForms - action after resize event

Is it possible to perform a specific action after the resize event (of the user control), for example when mouse button is released? I need to manually resize an inner control and doing it on every single firing of the event would be quite, hmm,…
brovar
  • 811
  • 4
  • 10
  • 25
15
votes
1 answer

Conditional Styling In Silverlight?

While I'm fine with standard control styling in silverlight I have recently began using more dynamic methods of fetching data to be displayed in items controls. One of the controls I am reworking is a collection of links. The issue I am having is…
deanvmc
  • 5,957
  • 6
  • 38
  • 68
15
votes
9 answers

Problem with dynamic controls in .NET

Problem with dynamic controls Hello all, I'm wanting to create some dynamic controls, and have them persist their viewstate across page loads. Easy enough, right? All I have to do is re-create the controls upon each page load, using the same IDs. …
user27293
  • 163
  • 1
  • 1
  • 5
15
votes
4 answers

What is best method to find a ASP.Net control using jQuery?

In implementing my first significant script using jquery I needed to find a specific web-control on the page. Since I work with DotNetNuke, there is no guaranteeing the controls ClientID since the container control may change from site to site. I…
Joe Brinkman
  • 1,842
  • 2
  • 16
  • 20
15
votes
6 answers

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" 'B(x).Name = "button_3" '... and i want to get…
user1831408
15
votes
6 answers

Time only pickers for .NET WinForms?

There are tons of good date pickers out there for Windows forms, but I have yet to find any good time only pickers. Any suggestions? EDIT I guess I should be more clear. I am talking about a nicer looking time picker. We use a commercial control…
TWA
  • 12,756
  • 13
  • 56
  • 92
15
votes
7 answers

Reacting to multi-buttons wired headphones

I am driving some experiments with a pair of a-JAYS Four headphones (having 3 buttons on its wired remote/mic) plugged onto a Galaxy Nexus (ICS 4.0.2). My issue is that only the middle button is 'recognised' by a test app I have written, i.e.…
Attila
  • 503
  • 1
  • 5
  • 20
14
votes
5 answers

How to get all children of a parent control?

I'm looking for an code example how to get all children of parent control. I have no idea how do it. foreach (Control control in Controls) { if (control.HasChildren) { ?? } }
The Mask
  • 17,007
  • 37
  • 111
  • 185
14
votes
1 answer

How can I determine which UIControlEvents type caused a UIEvent?

What I want to do is set up a bunch of UIControl objects to send all events through the same handler. That handler than needs to determine what the appropriate action is based on the UIControlEvents type that triggered. -…
MrHen
  • 2,420
  • 2
  • 25
  • 39
14
votes
3 answers

Linux: write a C program that 'controls' a shell

Suppose we have a shell running on terminal, let's say, /dev/pts/1. The shell is already running and we can't restart it. Now we want to write a C program that will 'control' the shell, i.e. which will itself provide a shell-like interface to the…
Leszek
  • 1,181
  • 1
  • 10
  • 21
14
votes
9 answers

Why do my WinForms controls flicker and resize slowly?

I'm making a program where I have a lot of panels and panels in panels. I have a few custom drawn controls in these panels. The resize function of 1 panel contains code to adjust the size and position of all controls in that panel. Now as soon as I…
user575579
  • 141
  • 1
  • 1
  • 3