Click here to Skip to main content
15,921,989 members
Home / Discussions / WPF
   

WPF

 
QuestionWPF Hierarchical Data Templates are killing me Pin
gantww26-Jul-08 17:32
gantww26-Jul-08 17:32 
AnswerRe: WPF Hierarchical Data Templates are killing me Pin
MIHAI_MTZ28-Jul-08 1:17
MIHAI_MTZ28-Jul-08 1:17 
GeneralRe: WPF Hierarchical Data Templates are killing me Pin
gantww28-Jul-08 13:37
gantww28-Jul-08 13:37 
QuestionWPF hyperlink Click event Pin
Suj_7825-Jul-08 4:45
Suj_7825-Jul-08 4:45 
AnswerRe: WPF hyperlink Click event Pin
Super Lloyd27-Jul-08 21:11
Super Lloyd27-Jul-08 21:11 
QuestionWPF Animation. Pin
ciacia24-Jul-08 20:13
ciacia24-Jul-08 20:13 
AnswerRe: WPF Animation. Pin
Jammer25-Jul-08 0:30
Jammer25-Jul-08 0:30 
QuestionFocus issue Pin
Alex Skye24-Jul-08 7:41
Alex Skye24-Jul-08 7:41 
I would be very grateful to anyone who would explain me what's wrong with my code.


In the code below I'm creating TextBoxes dynamically when user clicks on the TextBlock. I want each new TextBox be focused (i.e. the blinking cursor to be in the TextBox), but it works only for the first one. 2-nd, 3-rd and following TextBoxes became focused only when I switch to another tab in Firefox and than switch back again. How can I make the last created TextBoxes focused?

using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace TextBoxCase
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();

            TextBlock txtBlock = new TextBlock();
            txtBlock.Text = "Create new TexBox!";
            txtBlock.MouseLeftButtonDown += txtBlockClick;
            panel.Children.Add(txtBlock);
        }

        void txtBlockClick(object sender, MouseButtonEventArgs e)
        {
            TextBox txtBox = new TextBox();
            txtBox.Loaded += new RoutedEventHandler(txtBox_Loaded);
            panel.Children.Add(txtBox);
        }

        void txtBox_Loaded(object sender, RoutedEventArgs e)
        {
            ((TextBox)sender).Focus();
        }
    }
}

In the xaml code I only have StackPanel named "panel".
AnswerRe: Focus issue Pin
The Only Nock8-Aug-08 7:33
The Only Nock8-Aug-08 7:33 
QuestionMaintaing Session between WPF browser application and WCF service Pin
puneet.priyadarshi24-Jul-08 3:50
puneet.priyadarshi24-Jul-08 3:50 
Question[Message Deleted] Pin
C#_Programmer23-Jul-08 21:14
C#_Programmer23-Jul-08 21:14 
AnswerRe: color of wpf listview column Pin
Pete O'Hanlon24-Jul-08 4:33
mvePete O'Hanlon24-Jul-08 4:33 
GeneralRe: color of wpf listview column Pin
C#_Programmer24-Jul-08 8:32
C#_Programmer24-Jul-08 8:32 
GeneralRe: color of wpf listview column Pin
Pete O'Hanlon24-Jul-08 8:53
mvePete O'Hanlon24-Jul-08 8:53 
GeneralRe: color of wpf listview column Pin
Jammer24-Jul-08 22:52
Jammer24-Jul-08 22:52 
GeneralRe: color of wpf listview column Pin
Pete O'Hanlon24-Jul-08 23:59
mvePete O'Hanlon24-Jul-08 23:59 
GeneralRe: color of wpf listview column Pin
Jammer25-Jul-08 0:16
Jammer25-Jul-08 0:16 
QuestionSession state maintanace in wpf browser application Pin
puneet.priyadarshi23-Jul-08 20:35
puneet.priyadarshi23-Jul-08 20:35 
AnswerRe: Session state maintanace in wpf browser application Pin
John_Adams24-Jul-08 23:38
John_Adams24-Jul-08 23:38 
QuestionUser Control inside other User Control problem Pin
edu_fidi23-Jul-08 20:07
edu_fidi23-Jul-08 20:07 
AnswerRe: User Control inside other User Control problem Pin
Jammer24-Jul-08 11:49
Jammer24-Jul-08 11:49 
GeneralRe: User Control inside other User Control problem Pin
edu_fidi24-Jul-08 12:01
edu_fidi24-Jul-08 12:01 
GeneralRe: User Control inside other User Control problem Pin
Jammer24-Jul-08 12:30
Jammer24-Jul-08 12:30 
GeneralRe: User Control inside other User Control problem Pin
Jammer24-Jul-08 12:42
Jammer24-Jul-08 12:42 
GeneralRe: User Control inside other User Control problem Pin
edu_fidi24-Jul-08 13:10
edu_fidi24-Jul-08 13:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.