Click here to Skip to main content
15,867,568 members
Everything / Controls

Controls

controls

Great Reads

by Graeme_Grant
A Modern Toggle Switch - From mock concept to a full custom WPF control that you can plug into your own apps
by Ajcek84
Open source library for music engraving in desktop, mobile and web applications
by Leif Simon Goodwin
This article presents a simple WPF Carousel Control
by Edwyn Amador
Handles and validates input typing and pressed keys in TextBox, RichTextBox and ComboBox, displaying custom balloon tips messages

Latest Articles

by Member 4206974
FormGen, a JavaScript Form Generator
by Graham Wilson
A progress bar which displays progress as passage through a simple maze.
by Graham Wilson
A collection of simple .NET Framework/.NET WinForm controls and utilities.
by Graham Wilson
A track bar control which displays the track line as a spiral

All Articles

Sort by Score

Controls 

15 Nov 2017 by Graeme_Grant
A Modern Toggle Switch - From mock concept to a full custom WPF control that you can plug into your own apps
15 Jul 2018 by Ajcek84
Open source library for music engraving in desktop, mobile and web applications
21 Nov 2019 by Leif Simon Goodwin
This article presents a simple WPF Carousel Control
17 Jul 2019 by Edwyn Amador
Handles and validates input typing and pressed keys in TextBox, RichTextBox and ComboBox, displaying custom balloon tips messages
15 Jan 2024 by Member 4206974
FormGen, a JavaScript Form Generator
4 Jun 2012 by Espen Harlinn
Release the random artist inside you
19 Apr 2012 by Deepak_Sharma_
This article will show how to create an auto-suggest TextBox that will suggest data from a SQL Server database column.
13 Nov 2010 by Kunal Chowdhury «IN»
Customized Scrolling in Silverlight using Expression Blend
22 May 2012 by Mahfuzur Rahman.
Column based selection in rich edit control.
30 Nov 2011 by Marc Clifton
Revisiting the XTree implementation, using a generic controller.
16 Feb 2016 by Clifford Nelson
This article presents a behavior that can make another UIElement visible when the mouse down event occurs on the UIElement this behavior is attached to. Have extended this to directly support fading of a Popup control
25 Apr 2012 by Razi Syed
Easily bind a class to .NET data controls like GridView, FormView, etc., and get an updated object or list back in the code-behind effortlessly.
21 Mar 2022 by Peter Huber SG
WpfTestbench helps you to write sophisticated test windows for your WPF controls with few lines of code
24 Apr 2015 by Sergey Alexandrovich Kryukov
Please see my comment to the question.Please see my past answers:Append a picture within picturebox[^],draw a rectangle in C#[^],How do I clear a panel from old drawing[^].Other problems could be solved as you face them, but it's still better to make a good plan.—SA
23 Jul 2018 by Ajcek84
Implementation of radar chart for various .NET platforms
17 May 2023 by Olivier Levrey
[Description("Very basic slider control with selection range.")] public partial class SelectionRangeSlider : UserControl { /// /// Minimum value of the slider. /// [Description("Minimum value of the...
2 Sep 2022 by Peter Huber SG
Concurrent threads can use LogViewer to show the user scrollable information efficiently
24 Jul 2011 by Shai Raiten
In my previous posts about Kinect I've showed how to get started, how to change Angles and more cool stuff, but now it's time to start working on the real things, how to enable Kinect to your environment, I'm talking about PC.
20 Nov 2011 by Bernhard Hiller
That's far too obscure.All you need to do is store a reference to the TabPage instance which was removed from the TabPages collection of the TabControl. You may use the form where the TabControl is placed for that purpose.You could also create your own TabControl which has an extra property...
24 Jun 2012 by Sergey Alexandrovich Kryukov
The solution is simple: stop abusing PictireBox. This simple control class which could help you in simplest cases, not helping you here, only creates unwanted intermediate layer to eat up extra resources and waste extra development time giving nothing in return, compared to using a custom...
24 Mar 2011 by Espen Harlinn
Take a look at:WPF DataGrid Practical Examples[^]RegardsEspen Harlinn
11 Jul 2011 by BobJanova
Don't do it.Your controls should reflect the state of business objects (whether through formal data binding or, for a simple case, through setting properties in event handlers). In a really simple application (one form) the 'business objects' can be local fields of the form. Then, in other...
3 Jun 2012 by tdkmodchip
Toolbox popup component that is resizable and floats.
17 Jan 2014 by Jochen Arndt
You may use GetScrollBarInfo()[^]:bool bVisible = false;SCROLLBARINFO SbVert;SbVert.cbSize = sizeof(SbVert);if (GetLBox().GetScrollBarInfo(OBJID_VSCROLL, &SbVert)){ // Index 0 of rgstate is the scrollbar itself // See SCROLLBARINFO in the MSDN if (0 == sbi.rgstate[0] &...
22 Jul 2020 by siliconvideo
This StringBox control implements keystroke validation using regular expressions and a touch of glue logic
28 Feb 2011 by jmix90
Creating a full-screen window in WPF is quite simple, set WindowState to Maximized and WindowStyle to None. However, a border is still visible on the bottom and on the right sides. In this post we'll discover how to remove it.
8 Dec 2010 by Blesson Mathew
hi..i have experience in JQgrid..Which is easier to impliment and development.and much user friendly also...If u have any doubts about JQgrid..just ask to me..Thank you.
28 Dec 2010 by RaviRanjanKr
To Learn about UserControl you should Navigate the Given LinkUser Control With C#[^]
31 Jan 2011 by Nick Alexeev
22 Feb 2011 by wpfdev
This blog post is re-posted from www.eriklieben.com. Looking at the file tab of Word 2010, I’ve wondered if a WPF tab control could be transformed to this layout. At first, this felt like something that could never be done, without doing a lot of magic or building it from scratch...
15 Aug 2011 by Paul_Williams
The difference between ListBox and CheckedListBox DataBinding.
2 Sep 2011 by Rupesh Kumar Tiwari
Hi you can store the value instead of searching for id of the selected node in session and select/highlight the node based on the value stored in session.Please see below code: tree view HTML ...
6 Sep 2011 by Vangos Pterneas
A look at an advanced HTML5 feature: Web workers
19 Nov 2011 by User008
Drag 'n Drop asynchronous files from an external server or device
30 Nov 2011 by #realJSOP
Try using Environment.SpecialFolder.MyComputer, set the SelectedPath, and then call ShowDialog(). I did the following and it worked fine:FolderBrowserDialog dlg = new FolderBrowserDialog();dlg.RootFolder = Environment.SpecialFolder.MyComputer;dlg.SelectedPath = @"d:\dev";dlg.ShowDialog();
8 Feb 2012 by LanFanNinja
Check this out it will do what you are wanting to do. I cannot guarantee this code in anyway though because I have never done this before. I just came up with this messing around. :) Let me know if it works for you./// METHOD 3 ///Here is my last and final method I could come up with for...
9 May 2012 by Guillaume Waser
WPF Progress controls and comparing related threads methods
13 May 2013 by Walby
Whilst I have never tried to directly host a page in the canvas control, I can confirm that you can host it in a Frame control sitting on the canvas control. Then set the source of the Frame control to show the Page control. Please see below: Source="ChildPageView.xaml" ...
2 Aug 2013 by Ron Beyer
if (someflag == true) { if (lblsomelbl.InvokeRequired) lblsomelbl.Invoke((MethodInvoker) delegate { lblsomelbl.Text = "1234"; }); else lblsomelbl.Text = "1234"; }Basically you have to change properties that interact with the...
16 Jan 2014 by CBadger
Try thisbool bHScroll = (m_List.GetStyle()&WS_HSCROLL)!=0;bool bVScroll = (m_List.GetStyle()&WS_VSCROLL)!=0;// if not answer look at source :-)source[+]
16 Dec 2014 by BillWoodruff
If you use the stack-based recursive technique I demonstrate here [^], you can easily get all the Buttonsforeach(Control theControl in (SpecialMethods.GetAllControls(this)).OfType().ToList()){ // do something with/to/using each Button}There's another QA answer I posted yesterday...
25 Mar 2015 by TarikHuber
Use STT (SQL Table Toolkit) to bind WinForm Controls to a DataGridview and to define ComboBox data sources
28 May 2015 by OriginalGriff
Simple: handle the Resize event. public partial class MyUserControl : UserControl { public MyUserControl() { InitializeComponent(); ShowSize("Constructor"); } private void ShowSize(string from) { ...
25 Sep 2010 by Henry Minute
You don't have to.Take a look at this[^].
23 Dec 2010 by dmageiras
Do you use MS Access, Sql Server or what as a data source? In any case, I would try to:(a) change date delimiter, use # delimiter for Access and single quote (') for Sql Server,(b) change equal (=) operator with between operator (eg. filter = " between '2010/01/01 00:00' and '2010/12/31...
27 Dec 2010 by Jenny Quinn
I work for a State Legislature and I would like to create a page that is similar to the following page. http://www.destatis.de/bevoelkerungspyramide/[^]My “Men” side would be the bills introduced by the State Senate, and my “Women” side would be the State House. My “play” button would...
26 Feb 2011 by Henry Minute
To achieve your aims you will probably have to write a UITypeEditor[^] and one or more ControlDesigners or one of its descendants and quite possibly one or more TypeConverters. From your description possibly an ExpandableObjectConverter[^].Here is a link to an example that uses most of these.[^]
11 Mar 2011 by Noze
Hello,I have created a custom control Library called Base_Dialog and I built in Base_Dialog ---BaseDlglike this:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using...
3 May 2011 by Fredrik Bornander
You should remove it in the Unchecked event instead I think. Here's two solutions, depending on what criteria for identifying the control to remove:Private Sub RadioButton_Checked(sender As Object, e As RoutedEventArgs) Dim button As Button = New Button With {.Content = "Some...
14 May 2011 by Vishal chunne
protected void Page_Load(object sender, EventArgs e) { string connString = ConfigurationManager.ConnectionStrings["xls"].ConnectionString; // Create the connection object OleDbConnection oledbConn = new OleDbConnection(connString); try { ...
20 May 2011 by Koder Hack
The ContentTicker control is a generic control that can be used to slide content.
2 Nov 2011 by BillWoodruff
My "crystal ball" is cloudy, but ... I'm going to guess that the "static method" needs a reference to the instances of the custom controls (going to assume they are User Controls) which it doesn't have now ... since a Control, by definition, cannot be 'static.'Another guess might be the...
4 Nov 2011 by Christopher Devous
Well, not sure if this is the "right" way to do it, but I found what appears to be a working fix.Since the menu categories are created in code-behind, I added a null function to the navigate url property:MenuItem Category = new MenuItem();Category.Text =...
1 Feb 2012 by Sridhar Patnayak
Look these links.Similar post:How to display rowspan and colspan in gridview[^]http://marss.co.ua/MergingGridViewHeaderColumns.aspx[^]ThanksSP
26 Apr 2012 by coffee_machine
A component to add localized strings to a Form's res'x.
24 Jun 2012 by vlad781
On my form, I have a picture box that contains an image. This image, however, is too large for the box itself. I need a way where I can click and drag to pan the image, and use the scroll wheel to zoom in and out. I have searched through many posts but could not find a direct and efficient way...
1 Jul 2012 by Sergey Alexandrovich Kryukov
If you asked for the references to some code to help you in your work, you could do it by yourself. At the same time, you would have a chance that some CodeProject members pointed out some open-source works to help you.However, your requirement is to do this job "without using" something....
13 Jul 2012 by Sandeep Mewara
Object reference not set to an instance of an object This error happens when you try to use a property or call a method of an object that is null. More details: here[^] For now, it seems like:currItem.Item("Picture") or e.DataRepeaterItem.Controls("pbCategory") is Nothing.
11 Sep 2012 by JF2015
Have a look at this nice control:Circular gauge custom control for Silverlight 3 and WPF[^]or this one:http://wpfgauge.codeplex.com/[^]
4 Jun 2013 by Ron Beyer
http://msdn.microsoft.com/en-u...
4 Jun 2013 by Sergey Alexandrovich Kryukov
Please see my comment to the question. Even though anyone is free to create such a list, I don't think it could even be "official". The controls are not deprecated or claimed obsolete formally, even if some control is fully or completely superseded by a newer one. (I refer to ObsoleteAttribute,...
15 Jun 2013 by Ron Beyer
CAD software doesn't use controls for each object/line/rectangle. You use one control called a surface and draw on that surface. You then do your own object management.There is a limit to the number of GDI objects a program can have, and using one object per line/drawing object will quickly...
22 Aug 2013 by Coder Jet
For every item which is checked, you'll need to treat it as a DataRow. In order to do so, you can just cast it as a DataRowView and look for the 'Column' which contains the value you want.int[] currentSelectedValue = new int[this.checkedListBox1.CheckedItems.Count];for (int i = 0; i
11 Oct 2013 by ASP.NET Community
The GridView control was introduced with ASP.NET 2.0 and Visual Studio 2005 as a replacement for the DataGrid control.  While it has many
11 Oct 2013 by ASP.NET Community
Asp.net 2.0 came with a new set of controls that were designed to to be used for web parts. These controls were kept in the Web Part Toolbar. Here is
17 Oct 2013 by Javier Tirado Pampín
This article talks about how to solve the filter problem in Telerik MVC Extensions control suite
10 Feb 2014 by Karthik_Mahalingam
try thisprivate void checkBox1_CheckedChanged(object sender, EventArgs e) { bool flag = (sender as CheckBox).Checked; for (int i = 0; i
27 Mar 2014 by BillWoodruff
If you are willing to do the work to create a UserControl, you can combine a ListView, which supports Groups, with a TextBox, for displaying the selected List Item. It's actually pretty easy to do, but, if you are relatively new to C# and Windows Forms, and have no experience with UserControls,...
12 Oct 2014 by CHill60
Further to Solution 1 (recommended), assuming you stick with your current approach then TextBox1.Text is the contents of the text box.However, I think you should use Validating event in preference to the OnKeyPress event.You can still use OnKeyPress to ensure that only 0-9, comma and...
12 Oct 2014 by Maciej Los
Another way is to create Regex validator ;)Please, see: Validation with Regular Expressions Made Simple[^]
16 Dec 2014 by Sergey Alexandrovich Kryukov
You would need to create a recursive method traversing all controls of some parent control; for example:using System;using System.Windows.Forms;//...static void SubcribeToMouseEnterLeaveEvents(Control parent, EventHandler enterHandler, EventHandler leaveHandler) { foreach...
11 Dec 2015 by CHill60
Have a look at this CP article Professional C# - Graphics with GDI+[^]There is also a reference zone[^] here on CPOr there always the M$ documentation[^]
28 Mar 2017 by F-ES Sitecore
When the component is not visible view the source of the page, do you see your PanMsg div in the source? No, because if it's not visible it isn't rendered or sent to the client so how can your js interact with it?If you want to make something visible on the client side then don't set the...
24 Sep 2017 by Richard MacCutchan
Possible? Maybe: see ListBox Class (System.Windows.Controls)[^].
24 Sep 2018 by dan!sh
You can debug to check if row and row.Cells["s"] are null. Also, check if the column name you are providing is a valid one.
31 Aug 2010 by Prosanta Kundu online
I always prefer this approach belowASPX pageIn aspx.cs page Page_LoadPage.ClientScript.RegisterClientScriptBlock(Page.GetType(), "pageVars", string.Format("var TextBox1 = '{0}';", TextBox1.ClientID),true);When required...
19 Oct 2010 by Hiren solanki
You need to use Js onFocus Event.Suppose there are three textbox named,TextBox1,TextBox2,TextBox3Then write onFocus Event on TextBox3 Like.function focused(txt3){var result...
11 Nov 2010 by TweakBird
Have a look herehttp://www.asp.net/ajax/ajaxcontroltoolkit/samples/maskededit/maskededit.aspx[^]Download Video & Sample code on AJAX MaskedEdit Controlshttp://www.asp.net/ajax/videos/how-do-i-use-the-aspnet-ajax-maskededit-control[^]Change Mask attribute of below...
8 Dec 2010 by William Arnold
I changed the Character Set in the Project Properties from "use Multi-Byte" to "use Unicode" and I got the new colors on my push button control. Go figure.
17 Dec 2010 by vashikhan
Hello sir,In my Project I have to import data from an Excel spreadsheet and bind it with a datagridview control. In that I have to select particular sheet name(numbers). I have used opendialog throw which it will open excel sheet and please give me code.How to take excel sheet in...
28 Dec 2010 by jerrykid
References:http://msdn.microsoft.com/en-us/library/aa302342.aspx[^]http://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol.aspx[^]
5 Jan 2011 by BadJerry
Hi all,I am looking for an WYSIWIG HTML editing control to integrate in my MFC application... the control needs to be W3C compliant (XHTML) which means creating the tags in lower case, having the attributes between quotes, the adequate / when needed, etc...There are a few good controls...
19 Jan 2011 by OriginalGriff
Depending on which form creates the other, set up a public property in the created form which set to the DataSet and TableAdapter.So, if Form1 create Form2, then Form2 has:public DataSet dataToManipulate {get; set;}public TableAdapter tableToManipulate {get; set;}And Form1:Form2 frm...
21 Jan 2011 by Espen Harlinn
Sound like the font doesn't not include the required characters. Not all fonts support all unicode code points.RegardsEspen Harlinn
1 Feb 2011 by Not Active
border takes three parameters: type, color, and sizepbody.style.border = "solid black 1px";
1 Feb 2011 by Manas Bhardwaj
First of all, i would not recommend using the window.createPopup() at all. It is a IE specific thingie and would not work in any other browser.You should use a div to do this instead. Next, you seem to have declared pbody, but where has it been used. NOWHERE!
4 Feb 2011 by Nick Alexeev
My m_ctrlContainer was a "built-in" panel of a SplitContainer (as in splitContainer1.Panel1). That's why the collection was read-only. Well duh.This code had pointed me in the right direction.m_ctrlContainer.Parent.Controls.Remove(m_ctrlContainer); // threw exception “Collection is read...
7 Feb 2011 by Fredrik Bornander
This tip corrects my horrible attempt of a Spider Control
19 Feb 2011 by fjdiewornncalwe
How do you create the "gray square" in the first place. There is always the OnLostFocus Method.
19 Feb 2011 by Olivier Levrey
This is the default rendering for the Button class. If you want to remove that, then you will need to provide your own drawing functions for the button.You may need ButtonRenderer and this could help:http://msdn.microsoft.com/fr-fr/library/system.windows.forms.buttonrenderer(v=vs.80).aspx[^]
20 Feb 2011 by Sergey Alexandrovich Kryukov
Nothing in this question make sense as the code shows something absolutely wrong in the very beginning.The code shows some code fragment in UI thread, not the custom threads.Anything in UI thread should not be blocking, even all more a less long operations should be eliminated. First,...
24 Feb 2011 by Nish Nishant
Do you want to make custom controls/forms? Or are you wondering how the forms and buttons are themselves created?Assuming the latter, and also assuming Winforms (based on the terminology you used), Winforms just uses the native API to do this. CreateWindow and CreateWindowEx are the API...
24 Feb 2011 by fjdiewornncalwe
Try looking here.
26 Feb 2011 by Sergey Alexandrovich Kryukov
This is quite possible but not easy at all; you'll to write several things to allow custom edit in the PropertyGrid. I think modal form is not a good idea as you can do much better by providing a custom in-place editor. However, a modal form is also possible: you in-line editor will be the...
28 Feb 2011 by Anton Lesnichenko
Add AllowsTransparency="True" and there will not be a border.
9 Mar 2011 by phil2415
Hi all,I have a problem with binding a reorder list, the control that is part of the AJAX Control Toolkit. I hope you can help because I've spent hours developing it!I created the list and had it working perfectly, with insert, edit and delete commands, as well as reordering all...
10 Mar 2011 by Dylan Morley
Without automating Excel, which you shouldn't really do using server side code (and may run into permissions issues anyway), a way to achieve this is to use the similar code above but output valid HTML and save with the .xls extension. This will let you bold certain columns + apply general...
23 Mar 2011 by Dave Kreskowiak
You'd be better off asking for support from the companies that made these libraries. It's very unlikely anyone who has used these components will ever see your message.
24 Mar 2011 by QuickBooksDev
We have a large vb6 program that has many forms.We have the need to load then unload about 3 forms.After unloaded 1 and only 1 particular form we get 340 Control array element doesn't exist on frmStoreControls.fraBase(0).Left but NOT on frmStoreControls.fraBase(1).LeftfraBase is a...