1

I am having a strange problem in Windows phone. I am making a chat app and there's a Send Button near the message TextBox. When the user done typing he/she can hit send to send the text. However when Send Button is tapped the keyboard gets hidden and then the user has to hit Send again to send the message.

I am assuming this is because TextBox has the focus and it needs to send the focus to the button before button can work. Is there any way I can call the button click even in single tap instead of two taps?

Update:

Here's my XAML code:-

<Grid Grid.Row="2" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBox x:Name="MessageEditBox" PlaceholderText="Enter Message" Margin="10,10,0,10" InputScope="Chat"/>
            <Button x:Name="SendButton" Grid.Column="1" Content="Send" Margin="10,0" Click="SendButton_Click"/>
        </Grid>
0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184
  • I've just tried with a textbox and button besides and it seems to work propety - keyboard is being hidden and click engaged. How have you implemented the button? – Romasz Jan 05 '15 at 14:49
  • @Romasz I don't know what I did wrong but I tried it in another page and getting the same issue. I've added my XAML code in the question. – 0xC0DED00D Jan 05 '15 at 15:00
  • Can you try [this example from GitHub](https://github.com/Romasz/WP81RunTime-Examples/tree/master/TextBoxAndButton)? Maybe you have something else on your page that gets focused/tapped? – Romasz Jan 05 '15 at 15:06
  • Your example is working, but as soon as I lowered the Textbox at the bottom of the page, the issue returned. You can check them by having these values for RowDefinitions - – 0xC0DED00D Jan 05 '15 at 15:17
  • You are right that in this case there is such a problem. Can you try to use *Tapped* event instead of Click? – Romasz Jan 05 '15 at 15:58

0 Answers0