Reputation: 59
I am new in uwp.i have to create calculator using flyout feature.
how to open flyout below the textbox on textbox got focus.
Upvotes: 2
Views: 2727
Reputation: 2790
I used TextBlock instead of Textbox, but you can change that:
<TextBlock Text="Textblock with MenuFlyout" Height="20" Tapped="TextBlock_Tapped" x:Name="MyTextBlock">
<FlyoutBase.AttachedFlyout>
<MenuFlyout x:Name="Flyout">
<MenuFlyout.Items>
<MenuFlyoutItem>
Click Me
</MenuFlyoutItem>
</MenuFlyout.Items>
</MenuFlyout>
</FlyoutBase.AttachedFlyout>
</TextBlock>
The Code behind the TextBlock_Tapped event:
private void TextBlock_Tapped(object sender, TappedRoutedEventArgs e)
{
Flyout.ShowAt(MyTextBlock);
}
Upvotes: 1