本文整理汇总了C#中System.Windows.Controls.ComboBox.MoveFocus方法的典型用法代码示例。如果您正苦于以下问题:C# ComboBox.MoveFocus方法的具体用法?C# ComboBox.MoveFocus怎么用?C# ComboBox.MoveFocus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.ComboBox
的用法示例。
在下文中一共展示了ComboBox.MoveFocus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillDateControl
private void FillDateControl (ComboBox RessourceGroupSelection, String BookingGroup)
{
BrushConverter BRConverter = new BrushConverter ();
m_DateControlButtons.Children.Clear ();
DataSet Ressources = m_DataBase.GetCommonDataSet ("Select * from Ressource where BookingGroup = '"
+ BookingGroup + "' order by MainAdresse");
m_DateTimeControlButtons = m_XAML.CreateGrid (new int [] { 18, 20, 5, 5, 5, 10 }, new int [] { 1 });
m_DateControlButtons.Children.Add (m_DateTimeControlButtons);
Grid.SetRow (m_DateTimeControlButtons, 0);
Grid.SetColumn (m_DateTimeControlButtons, 2);
FillDateTimeBlock (m_DateTimeControlButtons);
List<String> MainAddresses = new List<string> ();
foreach (DataRow RessourceRow in Ressources.Tables ["Ressource"].Rows)
{
if (MainAddresses.Contains (RessourceRow ["MainAdresse"].ToString ()) == true)
continue;
MainAddresses.Add (RessourceRow ["MainAdresse"].ToString ());
}
if (MainAddresses.Count > 1)
{
Button MainAdressText = new Button ();
m_DateControlButtons.Children.Add (MainAdressText);
MainAdressText.Content = "Block";
Grid.SetRow (MainAdressText, 0);
Grid.SetColumn (MainAdressText, 0);
MainAdressText.FontSize = 20;
MainAdressText.FontWeight = FontWeights.ExtraBold;
MainAdressText.Foreground = (Brush)BRConverter.ConvertFromString ("Black");
MainAdressText.Background = (Brush)BRConverter.ConvertFromString ("#C0C0C0");
ComboBox MainAdresseCombo = new ComboBox ();
m_DateControlButtons.Children.Add (MainAdresseCombo);
MainAdresseCombo.SelectionChanged += new SelectionChangedEventHandler (MainAdresseCombo_SelectionChanged);
Grid.SetRow (MainAdresseCombo, 0);
Grid.SetColumn (MainAdresseCombo, 1);
MainAdresseCombo.FontSize = 20;
MainAdresseCombo.FontWeight = FontWeights.ExtraBold;
MainAdresseCombo.Foreground = (Brush)BRConverter.ConvertFromString ("LightGray");
MainAdresseCombo.Background = (Brush)BRConverter.ConvertFromString ("Blue");
List<String> ProcessMainAdresses = new List<string> ();
foreach (DataRow RessourceRow in Ressources.Tables ["Ressource"].Rows)
{
String MainAdresse = RessourceRow ["MainAdresse"].ToString ();
if (ProcessMainAdresses.Contains (MainAdresse))
continue;
ProcessMainAdresses.Add (MainAdresse);
ListBoxItem NewItem = new ListBoxItem ();
NewItem.Content = MainAdresse;
NewItem.Tag = RessourceRow;
MainAdresseCombo.Items.Add (NewItem);
}
m_TimeControlButtons.Children.Clear ();
m_BookingControlButtons.Children.Clear ();
MainAdresseCombo.IsDropDownOpen = true;
MainAdresseCombo.Focus ();
}
else
{
m_TimeControlButtons.Children.Clear ();
m_BookingControlButtons.Children.Clear ();
ActiveResource = Ressources.Tables ["Ressource"].Rows [0];
FillTimeControl (m_TimeControlButtons, m_BookingControlButtons, Ressources.Tables ["Ressource"].Rows [0]);
RessourceGroupSelection.MoveFocus (new TraversalRequest (FocusNavigationDirection.Next));
}
}