Reputation: 33
I want to know the width of the screen to set my popup's width in a Win8 App.
Upvotes: 2
Views: 1556
Reputation: 23774
Assuming you mean the height and width of the screen (or more exactly the height and width of the application window), you can get that from Window.Bounds
For example, here's code behind a button what will display the current window's width in a text box on that window:
void App68::MainPage::Button_Click_1(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
txtWidth->Text = Window::Current->Bounds.Width.ToString();
}
Upvotes: 2