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 7861245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:37:53+00:00 2026-06-02T22:37:53+00:00

I am seeking examples for creating a standard dialog/Login windows with OK and Cancel

  • 0

I am seeking examples for creating a standard dialog/Login windows with OK and Cancel buttons bottom right.

I am unsure whether to use StackPanels, Grids or dockpanels. I understand that it’s normally not correct to use the Canvas due the fact that you have to enter x and y values.

What I have created so far is the buttons for the Ok and Cancel

   <StackPanel Orientation="Horizontal" 
            FlowDirection="RightToLeft" Height="32">
        <Button Width="72" TabIndex="45" Margin="2,2,2,2">Cancel</Button>
        <Button Width="72" TabIndex="40" Margin="2,2,2,2">OK</Button>
    </StackPanel>

The kind of windows I want to create are the standard Dialog windows.

  • 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-06-02T22:37:55+00:00Added an answer on June 2, 2026 at 10:37 pm

    I would prefer the following markup:

     <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*"/>
            <ColumnDefinition Width="3*"/>
        </Grid.ColumnDefinitions>     
    
        <Grid Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions> 
    
            <TextBlock VerticalAlignment="Center">Username:</TextBlock>
            <TextBlock VerticalAlignment="Center" Grid.Row="1">Password:</TextBlock>
            <TextBox Grid.Column="1"  />
            <TextBox Grid.Row=1"" Grid.Column="1"  />
        </Grid>
    
        <Button Grid.Row="1">Ok</Button>
        <Button Grid.Row="1" Grid.Column="1">Cancel</Button>
    </Grid>
    

    Yes, it is also possible to reduce number of Grids to 1, but I see no point in it. Also one can use StackPanel instead of outer Grid.

    “The lightest markup” phrase can be interpreted differently. The lightest for developer is the most simple and clear. The lightest for computer is the fastest to initialize and render. As for the given case, the difference is really in 1 extra layout container. This really is not the case to make optimisations

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

Sidebar

Related Questions

I am trying to creating Cucumber/Gerkin BDD Feature and Scenario descriptions, and am seeking
I'm not seeking an answer but rather ideas and suggestions for creating a better
Right now I'm stuck between using PHP's native session management, or creating my own
I'm trying to use a System.Windows.Forms.DataGrid control in my Compact Framework 3.5 Window Mobile
In the question here a method for creating a compatible TValue to use with
Seeking your help to get off .epub(s) sea in iPhone world... I am trying
Seeking help to design a layout as shown here: http://docs.google.com/Doc?docid=0AQhgDtGvE2HgZGZ6cmtua185MTd0eGdyZmc&hl=en The major challenge I
Seeking means to get Fabric to automatically (instead of user-interactively) interact with shell commands
Just seeking confirmation here : apache Thrift protocol does not seem to support running
I'm seeking further clarification after seeing What is responsible for releasing NSWindowController objects? I'm

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.