You can create a DropDown in XAML, through the designer or code.
To create a C1DropDown control using XAML markup, complete the following steps:
XAML Copy Code <Window x:Class="C1WPFPropertyGridCS102809.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="288" Width="418" xmlns:c1="http://schemas.componentone.com/wpf/Basic">
XAML Copy Code <Grid> <c1:C1DropDown Height="30" Name="C1DropDown1" Width="100"/> </Grid>This markup will create an empty C1DropDown control named "C1DropDown1" and set the control's size.
XAML |
Copy Code
|
---|---|
<Grid x:Name="LayoutRoot">
|
Visual Basic |
Copy Code
|
---|---|
Imports C1.WPF |
C# |
Copy Code
|
---|---|
using C1.WPF;
|
Visual Basic |
Copy Code
|
---|---|
Public Sub New()
InitializeComponent()
Dim c1DropDown1 as New C1DropDown
c1DropDown1.Height = 30
c1DropDown1.Width = 100
LayoutRoot.Children.Add(c1DropDown1)
End Sub
|
C# |
Copy Code
|
---|---|
public Window1() { InitializeComponent(); C1DropDown c1DropDown1 = new C1DropDown(); c1DropDown1.Height = 30; c1DropDown1.Width = 100; LayoutRoot.Children.Add(c1DropDown1); } |
This code will create an empty C1DropDown control named "c1DropDown1", set the control's size, and add the control to the window.