Hey brother,
As per your query discussed above i came to know that your problem is about the setting focus to the element of you program. For that i have a solution which i got form one the forum and posting that here. So that you can try this and changed it according to your program to take in action. Hope you like it
Code:
<UserControl x:Class="WpfApplication.Control"
xmlns="Name of the site which you like"
xmlns:x="Name of the site which you like"
Height="400" Width="400">
<StackPanel Name="Stack Panell">
<TextBox Name="textbox1"/>
<ListBox Name="lstbox">
<ListBoxItem>Product 1</ListBoxItem>
<ListBoxItem>Product 2</ListBoxItem>
<ListBoxItem>Product 3</ListBoxItem>
</ListBox>
<Button Name="button1" Content="Button"/>
<Button Content="set focus" Click="button_Click"/>
</StackPanel>
</UserControl>
public partial class Control : User Control
{
public Control()
{
InitializeComponent();
}
private void button_Click(object sender, RoutedEventArgs e)
{ this.txtbox.Focus();
Keyboard.Focus(this.txtbox);
}
Bookmarks