WPF how to change which window opens firstThere is already an open DataReader associated with this Command which must be closed firstSet custom window position on wpfWPF App Doesn't Shut Down When Closing Main WindowSecond Window Positioning WPFA WPF window doesn't release the memory after closedOpen link in new tab or windowHow to make main window wait until a newly opened window closes in C# WPF?WPF - C# - open parent window only onceWPF Window Not VisibleWPF + Windows Forms, open a second Form as child of MainWindow from the first Form

NIntegrate doesn't evaluate

what kind of chord progession is this?

What is a really good book for complex variables?

In general, would I need to season a meat when making a sauce?

Who will lead the country until there is a new Tory leader?

What is Theresa May waiting for?

I unknowingly submitted plagarised work

Where is the logic in castrating fighters?

Count Even Digits In Number

Installed Tankless Water Heater - Internet loss when active

Why did David Cameron offer a referendum on the European Union?

Externally monitoring CPU/SSD activity without software access

Is the Indo-European language family made up?

Should breaking down something like a door be adjudicated as an attempt to beat its AC and HP, or as an ability check against a set DC?

Is it rude to call a professor by their last name with no prefix in a non-academic setting?

How to respond to an upset student?

I know that there is a preselected candidate for a position to be filled at my department. What should I do?

Any advice on creating fictional locations in real places when writing historical fiction?

Make 24 using exactly three 3s

Why are C64 games inconsistent with which joystick port they use?

Why aren't space telescopes put in GEO?

Why does Mjolnir fall down in Age of Ultron but not in Endgame?

Compaq Portable vs IBM 5155 Portable PC

My players want to grind XP but we're using milestone advancement



WPF how to change which window opens first


There is already an open DataReader associated with this Command which must be closed firstSet custom window position on wpfWPF App Doesn't Shut Down When Closing Main WindowSecond Window Positioning WPFA WPF window doesn't release the memory after closedOpen link in new tab or windowHow to make main window wait until a newly opened window closes in C# WPF?WPF - C# - open parent window only onceWPF Window Not VisibleWPF + Windows Forms, open a second Form as child of MainWindow from the first Form






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















Im using WPF to make a simple budget app for myself as practice and I can't figure out how to change which window opens first. I mean when you start the program , right now it opens the MainWindow, but I want it to open another window. I have tried this in my app.xaml.cs file:



 public partial class App : Application

void App_Startup(object sender , StartupEventArgs e)

GetNameWindow getNameWindow = new GetNameWindow();
getNameWindow.Show();




which I read was a way to do it but it doesn't work for me. I'm using c# and visual studio 2017. Thanks!










share|improve this question

















  • 1





    Have a look at app.xaml file

    – Sir Rufo
    Mar 24 at 3:54

















1















Im using WPF to make a simple budget app for myself as practice and I can't figure out how to change which window opens first. I mean when you start the program , right now it opens the MainWindow, but I want it to open another window. I have tried this in my app.xaml.cs file:



 public partial class App : Application

void App_Startup(object sender , StartupEventArgs e)

GetNameWindow getNameWindow = new GetNameWindow();
getNameWindow.Show();




which I read was a way to do it but it doesn't work for me. I'm using c# and visual studio 2017. Thanks!










share|improve this question

















  • 1





    Have a look at app.xaml file

    – Sir Rufo
    Mar 24 at 3:54













1












1








1








Im using WPF to make a simple budget app for myself as practice and I can't figure out how to change which window opens first. I mean when you start the program , right now it opens the MainWindow, but I want it to open another window. I have tried this in my app.xaml.cs file:



 public partial class App : Application

void App_Startup(object sender , StartupEventArgs e)

GetNameWindow getNameWindow = new GetNameWindow();
getNameWindow.Show();




which I read was a way to do it but it doesn't work for me. I'm using c# and visual studio 2017. Thanks!










share|improve this question














Im using WPF to make a simple budget app for myself as practice and I can't figure out how to change which window opens first. I mean when you start the program , right now it opens the MainWindow, but I want it to open another window. I have tried this in my app.xaml.cs file:



 public partial class App : Application

void App_Startup(object sender , StartupEventArgs e)

GetNameWindow getNameWindow = new GetNameWindow();
getNameWindow.Show();




which I read was a way to do it but it doesn't work for me. I'm using c# and visual studio 2017. Thanks!







c# wpf window






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 3:49









Yummy275Yummy275

737




737







  • 1





    Have a look at app.xaml file

    – Sir Rufo
    Mar 24 at 3:54












  • 1





    Have a look at app.xaml file

    – Sir Rufo
    Mar 24 at 3:54







1




1





Have a look at app.xaml file

– Sir Rufo
Mar 24 at 3:54





Have a look at app.xaml file

– Sir Rufo
Mar 24 at 3:54












1 Answer
1






active

oldest

votes


















1














To change the startup window, open App.xaml and replace "MainWindow.xaml" with your window:



StartupUri="GetNameWindow.xaml">


For what you were trying to do, you would need to remove StartupUri="MainWindow.xaml" and instead use Startup="App_Startup" and then it would call your event Handler at startup.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55320565%2fwpf-how-to-change-which-window-opens-first%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    To change the startup window, open App.xaml and replace "MainWindow.xaml" with your window:



    StartupUri="GetNameWindow.xaml">


    For what you were trying to do, you would need to remove StartupUri="MainWindow.xaml" and instead use Startup="App_Startup" and then it would call your event Handler at startup.






    share|improve this answer



























      1














      To change the startup window, open App.xaml and replace "MainWindow.xaml" with your window:



      StartupUri="GetNameWindow.xaml">


      For what you were trying to do, you would need to remove StartupUri="MainWindow.xaml" and instead use Startup="App_Startup" and then it would call your event Handler at startup.






      share|improve this answer

























        1












        1








        1







        To change the startup window, open App.xaml and replace "MainWindow.xaml" with your window:



        StartupUri="GetNameWindow.xaml">


        For what you were trying to do, you would need to remove StartupUri="MainWindow.xaml" and instead use Startup="App_Startup" and then it would call your event Handler at startup.






        share|improve this answer













        To change the startup window, open App.xaml and replace "MainWindow.xaml" with your window:



        StartupUri="GetNameWindow.xaml">


        For what you were trying to do, you would need to remove StartupUri="MainWindow.xaml" and instead use Startup="App_Startup" and then it would call your event Handler at startup.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 24 at 4:33









        Tanner OTanner O

        263




        263





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55320565%2fwpf-how-to-change-which-window-opens-first%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript