Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4244434
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:42:26+00:00 2026-05-21T03:42:26+00:00

My application builds and runs fine. I get an icon in the taskbar showing

  • 0

My application builds and runs fine. I get an icon in the taskbar showing that the window exists, but it never shows. I call StartupUri=”MainWindow.Xaml” from app.xaml and mainwindow just contains some functions and InitializeComponent(). When debugging, it runs until the window is supposed to open, then stops, and I cannot step through anything anymore. I can’t even tell where the debugger is because the yellow highlight is gone and the code doesn’t change. I am supposing it is waiting on user interaction at this point because it thinks the window opened successfully. Any Ideas?

public partial class App : Application
{
    private void Application_Startup(object sender, StartupEventArgs e)
    {
        foreach (string s in TZClock.Properties.Settings.Default.Clocks)
        {
            // x, y, currentCity, color
            Globals.state = s.Split(',');

            MainWindow NewWindow = new MainWindow();
            NewWindow.Top = double.Parse(Globals.state[0]);
            NewWindow.Left = double.Parse(Globals.state[1]);
            Globals.currentCity = Globals.state[2];
            Globals.color = Globals.state[3];
            NewWindow.Show();
        }
    }
}
<Window x:Class="TZClock.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:p="clr-namespace:TZClock.Properties"
            WindowStartupLocation="Manual" Loaded="Window_Loaded"
            Height="155" Width="271" 
            Left="{Binding Source={x:Static p:Settings.Default}, Path=Left, Mode=TwoWay}" 
            Top="{Binding Source={x:Static p:Settings.Default}, Path=Top, Mode=TwoWay}">

    <Grid Height="120" Width="258" Margin="0,0,0,0" >
        <Rectangle Opacity=".75" Fill="{Binding Source={x:Static p:Settings.Default}, Path=Color, Mode=TwoWay}" RadiusX="8" RadiusY="8"
                   Stroke="#FF94B494" StrokeThickness="5" Margin="0,0,12,12"></Rectangle>
        <ComboBox Name="DropDown" Width="139" Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" 
                  Margin="51,13,0,0"  VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
                  SelectionChanged="DropDown_SelectionChanged" />
    </Grid>
</Window>
public partial class MainWindow : Window
{
    public MainWindow()
    {
        this.Uid = Globals.num.ToString();
        InitializeComponent();
        LoadCityDictionary();
        displayTimeZoneInfo();
        scheduleTimer();
    }

    private void scheduleTimer()
    {
        // http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer.aspx
        // schedule a new, timed thread to refresh time (will not block the UI Thread)
        DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
        dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
        dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
        dispatcherTimer.Start();
    }

    private void dispatcherTimer_Tick(object sender, EventArgs e)
    {
        // http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer.aspx
        // refresh time label by current timezone
        Time.Content = (TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.Now, currentZone)).ToLongTimeString();
        Date.Content = (TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.Now, currentZone)).ToShortDateString();

        // Forcing the CommandManager to raise the RequerySuggested event
        CommandManager.InvalidateRequerySuggested();
    }

    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        this.DropDown.SelectedValue = Globals.currentCity;
    }

    private void DropDown_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        Globals.currentCity = DropDown.SelectedItem.ToString();
        TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById(d[Globals.currentCity]);

        Time.Content = TimeZoneInfo.ConvertTime(DateTime.Now, tz).ToLongTimeString();
        Date.Content = TimeZoneInfo.ConvertTime(DateTime.Now, tz).ToShortDateString();
        Location.Content = (tz.IsDaylightSavingTime(TimeZoneInfo.ConvertTime(DateTime.Now, tz)) ? tz.DaylightName : tz.Id);

        currentZone = tz.Id;

        Properties.Settings.Default.CurrentCity = Globals.currentCity;
        Properties.Settings.Default.Save();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T03:42:27+00:00Added an answer on May 21, 2026 at 3:42 am

    I suspect the window is there, but outside the bounds of the screen… check the values you assign to Top and Left

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've got an application that builds and runs fine. I started playing with
I have a processing based Java application that runs fine in Eclipse but the
I have build a web application that runs fine though Visual studio, but now
My application builds and runs fine on 10.6. I have Base SDK set to
My application builds, runs, simulates etc. etc. fine! Everything works 100% on both the
I'm using Visual C++ 6, and my application builds and runs fine in debug
I have an application that builds a left menu that is based on a
I inherited an ASP.NET application that builds pages with massive viewstate values. As I
I am working on an application that builds a vector of structs for items
I'm trying to build an application that builds a resource file into a jar,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.