积极答复者
message形式的对话框

问题
答案
-
...
我的想法是用ScrollViewer + StackPanel好了,系统自带的Messager 是HTML方案的,所以会不一样。
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
- 已标记为答案 Jie BaoModerator 2012年10月8日 8:38
全部回复
-
自己用Popup设计一个,如果你要防止用户在显示Popup的时候点击你的应用,你可以后面放置一个全屏的半透明矩形进行遮盖。
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
- 已建议为答案 alienwareM22X 2012年9月20日 6:51
-
XAML:
<Grid x:Name="layoutroot" Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> <Button VerticalAlignment="Top" Content="Show message" Click="Button_Click_1"/> </Grid>
C#:
private void Button_Click_1(object sender, RoutedEventArgs e) { Rectangle rect = new Rectangle() { Width = Window.Current.Bounds.Width, Height = Window.Current.Bounds.Height, Fill = new SolidColorBrush(Color.FromArgb(0xaa, 0x55, 0x55, 0x55)) }; layoutroot.Children.Add(rect); Popup popup = new Popup() { VerticalOffset = (Window.Current.Bounds.Height - 200) / 2 }; Grid grid = new Grid() { Background = new SolidColorBrush(Colors.Black), Width = Window.Current.Bounds.Width, Height = 200 }; TextBlock message = new TextBlock() { Text = "Hello Windows 8", FontSize = 30, Margin = new Thickness(30) }; Button okbtn = new Button { Content = "OK", HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Right, VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Bottom, Margin = new Thickness(30) }; okbtn.Click += (s, earg) => { if (popup.IsOpen) { popup.IsOpen = false; layoutroot.Children.Remove(rect); } }; grid.Children.Add(message); grid.Children.Add(okbtn); popup.Child = grid; popup.IsOpen = true; } }
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
- 已建议为答案 alienwareM22X 2012年9月20日 6:51
-
...
我的想法是用ScrollViewer + StackPanel好了,系统自带的Messager 是HTML方案的,所以会不一样。
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
- 已标记为答案 Jie BaoModerator 2012年10月8日 8:38