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
24
votes
5 answers

Bring Winforms control to front

Are there any other methods of bringing a control to the front other than control.BringToFront()? I have series of labels on a user control and when I try to bring one of them to front it is not working. I have even looped through all the controls…
Nathan
  • 5,059
  • 16
  • 48
  • 61
24
votes
1 answer

WPF user control bind data to user control property

I have user control: xaml
user1736332
  • 693
  • 4
  • 11
  • 22
23
votes
5 answers

Handle editable hierarchical data / TreeView~DataGrid hybrid

I am looking for a WPF control which is a hybrid of TreeView and DataGrid, something like the Visual Studio debugger or QuickBooks contacts list etc. Any other solution on how to handle editable hierarchical data in WPF will be very welcommed as…
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
23
votes
2 answers

How can I create a tagging control similar to evernote in wpf?

I like the tagging control in Evernote (windows version) and was wondering if there is something similar out there? I have only been able to find tag cloud controls. Specifically, I like the free format typing like in a text box that looks up and…
Kevin
  • 4,567
  • 1
  • 28
  • 36
23
votes
2 answers

Stretch items to fill canvas

I have a Dockpanel with items inside a Canvas. The Dockpanel and any other items (Grid etc) that I place inside the Canvas, only take up their minimum required space. How do I stretch these items to fill the entire Canvas?
JosephGarrone
  • 4,081
  • 3
  • 38
  • 61
22
votes
6 answers

asp:RequiredFieldValidator does not validate hidden fields

It seems that ASP.NET validators do not validate hidden fields. I get messages like this: Control 'hiddenField' referenced by the ControlToValidate property of 'hiddenFieldValidator' cannot be validated. I have an in my page…
meme
  • 243
  • 1
  • 2
  • 5
22
votes
1 answer

SharedSizeGroup in ListView.ItemTemplate

I have this scenario where I want to share the column size among all the ListViewItems, and I'm using SharedSizeGroup on the column definitions but it doesn't work:
Carlo
  • 25,602
  • 32
  • 128
  • 176
22
votes
3 answers

Send media action on android

I'm looking for a way to send global media action (Play/pause, Next, Previous) to the phone, much like it can take it froma bluetooth paired radio/speaker. I have found the MediaController class…
Remy Grandin
  • 1,638
  • 1
  • 14
  • 34
22
votes
3 answers

C#: Anchored Panel won't resize properly

I've a strange problem regarding auto sizing of a panel in a user control. This panel is anchored to all 4 sides of the user control. But the anchoring not always works as it should: If the user control is resized by resizing the form, the right and…
Jan-Patrick Ahnen
  • 1,380
  • 6
  • 17
  • 31
21
votes
5 answers

HTML Editor in a Windows Forms Application

We are looking for a WYSIWYG editor control for our windows application (vb.net or c#) so that users can design HTML emails (to send using the SMTP objects in the dot net framework) before sending. Currently all the available editors we can find…
John
  • 29,788
  • 18
  • 89
  • 130
21
votes
10 answers

JQuery Mobile trigger('create') command not working

JQuery Mobile is making my cry tonight. I'm trying to build custom controls so I don't repeat certain elements through my app, and it's giving me a hard time. Specifically, I have the following in an HTML file:
Anthony
  • 5,275
  • 11
  • 50
  • 86
21
votes
5 answers

WPF Control Flip

I've got a control that is mainly comprised of an image and a button. I want to display the image meta data on the back of the image and have the control flip horizontally when the button is pressed: i.e. Click the "info" button... Rotate the…
CatBusStop
  • 3,347
  • 7
  • 42
  • 54
21
votes
7 answers

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 but the associated click event that should display…
Fred FLECHE
  • 432
  • 1
  • 5
  • 11
21
votes
5 answers

Drop shadow in Winforms Controls?

is there a way to add a drop shadow to controls? are there any controls out there with this feature?
Luiscencio
  • 3,855
  • 13
  • 43
  • 74
21
votes
4 answers

Stop/Start service in code in Windows 7

I am trying to write a app and service which monitor a given set of services and a) makes sure they are running and b) based on certain criteria, restart them as needed. I keep running into an access denied error. If I simply iterate through the…
Mark
  • 211
  • 1
  • 2
  • 3