Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the equivalent of SetFocus()
Message
From
11/02/2009 12:58:50
 
 
To
10/02/2009 01:33:03
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Miscellaneous
Thread ID:
01380470
Message ID:
01380980
Views:
51
>What C# code would I use to set the focus to the named WPF TextBox below:
>
>I've tried txtPattern.Focus(), but it does nothing.
>
>
>
><TextBox Name="txtPatternName" Text="{Binding Path=PatternName, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Width="150" />
>
Not sure how far you got with this. But you probably need to do something like this:
      Dispatcher.BeginInvoke(DispatcherPriority.Input,
                            new ThreadStart(delegate()
                            {
                            txtPatternName.Focus();
                            }));
Focus does work, but has to be executed at the right time.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform