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

Controlling z-axis / bring-to-front at runtime (Delphi)

In Delphi, how do you control a visual control's z-axis position at runtime? e.g. How, programmatically and at runtime, do you accomplish the equivalent of (from the IDE main menu) "Edit -> Bring to Front" at designtime?
Jamo
  • 3,238
  • 6
  • 40
  • 66
16
votes
7 answers

Control 'seems' to be locked

I'm trying to change properties to a control however it seems as if it's "locked" but in reality, it isn't because when I right-click on the control it shows the control as being unlocked. I'm using Visual Studio 2005, and I've never worked with a…
MPaul
  • 2,553
  • 3
  • 20
  • 34
16
votes
4 answers

How do I reset a .NET Windows Forms TextBox BackColor property?

The default behavior of property BackColor of a TextBox is as follows: when enabled, it is White (SystemColors.Window), when disabled it is Gray (not sure what SystemColor this is). If I change the BackColor property, the same color is used for both…
Patrick McDonald
  • 64,141
  • 14
  • 108
  • 120
16
votes
2 answers

How can I conditionally disable a control in Storybook based on the value of another argument?

I am trying to conditionally disable a Storybook.js control based on the value of another argument. For example, I have a modal component that can be of type 'alert', 'confirmation', 'content', or 'photo'. All of these modal types, except for…
Wil S.
  • 233
  • 2
  • 7
16
votes
2 answers

iOS Controls for .NET (WPF)

I am currently writing a WPF application for consumption by tablet devices via Citrix (not my choice and not flexible...). In so far as is possible I would like to make the user interface tablet friendly. I was wondering if there are any controls…
Jason Irwin
  • 1,985
  • 2
  • 29
  • 42
16
votes
7 answers

What's the Literal control used for and what's the difference to the Label Control in asp.net?

What Literal control is used for in asp.net? and What is the difference between them and Label control?
ecleel
  • 11,748
  • 15
  • 48
  • 48
16
votes
7 answers

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: Form 1 public int MyListBoxSelectedIndex { …
wulfgarpro
  • 6,666
  • 12
  • 69
  • 110
16
votes
4 answers

.NET C#: WebBrowser control Navigate() does not load targeted URL

I'm trying to programmatically load a web page via the WebBrowser control with the intent of testing the page & it's JavaScript functions. Basically, I want to compare the HTML & JavaScript run through this control against a known output to…
Dave
  • 243
  • 1
  • 4
  • 9
16
votes
2 answers

ControlStyles.DoubleBuffer vs. ControlStyles.OptimizedDoubleBuffer

What is the difference between ControlStyles.DoubleBuffer and ControlStyles.OptimizedDoubleBuffer? ControlStyles.DoubleBuffer does not show up in the Intellisense drop down whereas ControlStyles.OptimizedDoubleBuffer is in fact listed. The MSDN…
user113476
16
votes
2 answers

Detecting a control's focus in Silverlight

Is there any way to tell whether a control (specifically a System.Windows.Controls.TextBox) is focused in Silverlight? I'm looking for something like the following (what you would see in a regular .Net application): textBox.Focused This seems like…
Dov
  • 15,530
  • 13
  • 76
  • 177
15
votes
4 answers

WPF Tab Key Navigation

We have a WPF .NET 4.0 C# based application. We built our user interface from XML definitions (not XAML) but underneath we use a WPF to present the UI. That is at runtime, we create the WPF UI based on our XML definition. We have a problem with tab…
user90150
15
votes
4 answers

Force a WPF control to refresh?

We have two textBlocks like this: (we used .NET FW 3.0)
Cooper.Wu
  • 4,335
  • 8
  • 34
  • 42
15
votes
3 answers

Readonly textbox for WPF with visible cursor (.NET 3.5)

I need my textbox to be read-only. However, when I set the IsReadOnly to true, then the user can no longer interact with the textbox using the keyboard since the cursor no longer appears. In .NET 4 there is a IsReadOnlyCaretVisible property,…
VitalyB
  • 12,397
  • 9
  • 72
  • 94
15
votes
2 answers

WPF Control: where is "OnLoaded" virtual function?

In WinForm's control, there is an OnLoaded virtual function, but this seems to be missing in WPF control. I found this function very useful in some situations. For example, I could do something here after the control is "completely" initialized. In…
newman
  • 6,841
  • 21
  • 79
  • 126
15
votes
9 answers

Is there a good WPF pivot control?

Does anyone have any experience with a good wpf pivot table control?
Bill Mahoney
  • 281
  • 1
  • 4
  • 8