====== jUserControl ====== The ''jUserControl'' control is analogous the [[https://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol%28v=vs.90%29.aspx|.Net Compact Framework's UserControl]], but has a much more rich appearance, and a few additional features. Like the .Net Compact Framework's UserControl, its primary purpose is to provide the ability to create [[https://msdn.microsoft.com/en-us/library/ms171725%28v=vs.90%29.aspx#Anchor_1|composite controls]]. ===== Creating a jUserControl ===== To create a new jUserControl, use the //Project//-->//Add New Item...// menu, and choose the //jUserControl// template. {{ .:usercontroltemplate.png }} After adding the new ''jUserControl'' to the project, the designer will appear and child controls can be added. {{ .:usercontroladdchildcontrols.mp4?569x320 }} **HINT**: By default, the ''Fill'' property is ''Transparent'' which may make the background look strange since there are no other controls behind it. To make using the designer easier, change the ''Fill'' property to an opaque color. When designing is finished, and if transparency is desired, changed it back to ''Transparent''. ===== Fill and Border Properties ===== The ''Fill'' and ''Border'' properties are used to color the interior of the control and the perimeter of the control, respectively. For more information, please see [[.:Fills, Strokes, and Borders]]. ===== Text Features ===== ''jUserControl'' employs the same text features used by many of the other controls in the jControls CF35 library including ''ForeColor'', ''TextOffset'', ''TextAlignment'', and ''TextWrap''. See [[.:Text Features]] for more information. ===== Example ===== This example shows a ''LabeledValue'' control which consists of two labels: one holding a value "0.00", and one labeling that value "Label". {{ .:labeledvaluedesigner.png }} With this ''LabeledValue'' control, it is much more convenient and consistent to create a table of name-value fields than creating each label individually. {{ .:labeledvalueaddtoform.mp4?854x480 }} ===== Visual Studio Toolbox Oddities ===== Sometimes, after creating [[.:custom controls]] or user controls, the controls don't show up in the Visual Studio toolbox. The Visual Studio toolbox is notoriously flaky, and we believe this is due to bug(s) in Visual Studio. To get the new control to appear in the toolbox, close all open files, rebuild the solution, then open one of the UI designers (e.g. the application's form).