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
18
votes
6 answers

Reordering of controls within a flow layout panel

I'm having trouble using the flowlayoutPanel in a C# winform application. What I basically have is a flow layout panel that has 3 sections. Section #1 is a set of 2 controls .. two dropdown controls, they are always in the same order, always visible…
user26901
18
votes
5 answers

How to compare branches in xcode

I am using xcode and its source controler. I would like to compare two branches I made. Impossible to do so by using the comparison mode. When I do it, it splits the editor in two (that is right) but I cannot put on branches on one side and the…
user1885349
  • 372
  • 1
  • 2
  • 10
18
votes
2 answers

Accidentally deleted .git folder - can it be restored?

I was fixing my packages and what not on Eclipse as I had too many redundant ones. A rookie error led me to deleting my .git folder from my drive. Is there any way I can recover my history from github? My repository is still active on github itself,…
user3186023
18
votes
3 answers

Disabling all but one child control in a WPF window

I have a bunch of controls on my window. One of them is a refresh button that performs a cumbersome task on a background thread. When the user clicks the refresh button, I put the cursor in a wait (hourglass) status and disable the whole window --…
Rob Sobers
  • 20,737
  • 24
  • 82
  • 111
18
votes
5 answers

How to disable all controls on the form except for a button?

My form has hundreds of controls: menus, panels, splitters, labels, text boxes, you name it. Is there a way to disable every control except for a single button? The reason why the button is significant is because I can't use a method that disables…
Ryan Peschel
  • 11,087
  • 19
  • 74
  • 136
18
votes
3 answers

android - overdraw layout allows touch through LinearLayout

in the following UI I have this below drabable overlaying the entire screen. The LinearLayout is transparent and allows controls below it to be clickable or touchable. Basically I can scroll a list below this LinearLayout as well as click controls.…
dropsOfJupiter
  • 6,763
  • 12
  • 47
  • 59
17
votes
2 answers

What are the differences between User Controls, Server Controls & Custom Controls?

I thought I had reasonable answers for this question at a recent interview, but I bombed it. :( What are the major differences between the three? If not obvious by the answer to the previous bullet, when would you choose one over the other?
IAmAN00B
  • 1,913
  • 6
  • 27
  • 38
17
votes
6 answers

C# WPF how to set location,width and height of the controls programmatically?

I'm doing my first WPF application. im having problem whereby when my form is maximized or fullscreen, my controls wont resize and just stay in the same location. only the form is maximized. in winform, I can do the adjustment in the .cs like the…
Psychocryo
  • 2,103
  • 8
  • 26
  • 33
17
votes
4 answers

How to determine which control on form has focus?

I've read elsewhere on here that to capture "Enter" key stroke in a text box and use it as if pushing a button I should set the KeyPreview property of the form to true and check the value of KeyDown. I want to be able to use this functionality on…
G-.
  • 1,061
  • 3
  • 11
  • 29
17
votes
9 answers

What is the best way to clear all controls on a form C#?

I do remember seeing someone ask something along these lines a while ago but I did a search and couldn't find anything. I'm trying to come up with the cleanest way to clear all the controls on a form back to their defaults (e.g., clear textboxes,…
Nathan W
  • 54,475
  • 27
  • 99
  • 146
17
votes
2 answers

ToolStripStatusLabel DoubleClick does not work?

Does ToolStripStatusLabel DoubleClick ever work? Private Sub myToolStripStatusLabel_DoubleClick(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles myToolStripStatusLabel.DoubleClick MessageBox.Show("WORKING!") End…
serhio
  • 28,010
  • 62
  • 221
  • 374
17
votes
3 answers

What event can be captured when an HTML hidden input value is set / changed

HI, In JavaScript when value is set to a hidden input control, which event is fired?
user239635
  • 301
  • 2
  • 4
  • 8
17
votes
6 answers

Need I remove controls after disposing them?

.NET 2 // dynamic textbox adding myTextBox = new TextBox(); this.Controls.Add(myTextBox); // ... some code, finally // dynamic textbox removing myTextBox.Dispose(); // this.Controls.Remove(myTextBox); ?? is this needed Little…
serhio
  • 28,010
  • 62
  • 221
  • 374
17
votes
3 answers

Find components on a windows form c# (not controls)

I know how to find and collect a list of all the controls used in a Windows Form. Something like this: static public void FillControls(Control control, List AllControls) { String controlName = ""; controlName = control.Name; …
Craig Stevensson
  • 1,336
  • 4
  • 21
  • 43
17
votes
2 answers

TTabSet vs. TTabControl vs. TPageCtrl/TTabSheet?

I was wondering why Delphi (2007) provides three widgets that seem to do the same thing, and what the advantages/disadvantages are for each. On the same topic, if I want to display different sets of controls, why should I favor eg. PageControl +…
Gulbahar
  • 5,343
  • 20
  • 70
  • 93