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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:50:36+00:00 2026-05-26T07:50:36+00:00

I would like to create a form dynamically instead of using the XAML to

  • 0

I would like to create a form dynamically instead of using the XAML to do it.
The form reside into a tab control. Below is XAML code:

this is a XAML sample.

<TabControl>
<TabItem Header="SVRS Data" Name="tab_SVRS_Data2">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="113*" />
            <ColumnDefinition Width="113*" />
            <ColumnDefinition Width="55*" />
            <ColumnDefinition Width="58*" />
            <ColumnDefinition Width="113*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="13" />
            <RowDefinition Height="24" />
            <RowDefinition Height="15" />
            <RowDefinition Height="24" />
            <RowDefinition Height="24" />
            <RowDefinition Height="24" />
            <RowDefinition Height="24" />
            <RowDefinition Height="5" />
            <RowDefinition Height="24" />
            <RowDefinition Height="24" />
            <RowDefinition Height="5" />
            <RowDefinition Height="24" />
            <RowDefinition Height="24" />
            <RowDefinition Height="24" />
            <RowDefinition Height="24" />
            <RowDefinition Height="5" />
            <RowDefinition Height="24" />
            <RowDefinition Height="24" />
            <RowDefinition Height="24" />
            <RowDefinition Height="5" />
            <RowDefinition Height="24" />
            <RowDefinition Height="5" />
            <RowDefinition Height="24" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button Name="btn_SaveSVRSDataDyn" Content="Save" Grid.Column="4" Grid.Row="1"  ToolTip="Saves the changes to the SVRS data " FontWeight="Bold" Click="btn_SaveSVRSData_Click" />

        <TextBox Name="SVRS_OuterEnvelopeId2" Grid.Column="0" Grid.Row="1" Style="{StaticResource InputBoxes}" Grid.ColumnSpan="2" />
        <Label Content="Outer Enveloppe ID" Grid.Column="0" Grid.Row="1" Style="{StaticResource LabelsOverlay}" Grid.ColumnSpan="2" Margin="5,0" />

        <TextBox Name="SVRS_LastName2" Grid.Row="3" Style="{StaticResource InputBoxes}" Grid.ColumnSpan="2" Uid="Elector"/>
        <Label Content="Last Name" Grid.Row="3" Style="{StaticResource LabelsOverlay}" Grid.ColumnSpan="2" Margin="5,0"/>

        <TextBox Name="SVRS_FirstName2" Grid.Row="4" Style="{StaticResource InputBoxes}" Grid.ColumnSpan="2" Uid="Elector"/>
        <Label Content="First Name" Grid.Row="4" Style="{StaticResource LabelsOverlay}" Grid.ColumnSpan="2" Margin="5,0"/>

        <TextBox Name="SVRS_MiddleName2" Grid.Column="2" Grid.Row="3" Style="{StaticResource InputBoxes}" Grid.ColumnSpan="3" Uid="Elector" Margin="1" />
        <Label Content="Middle Name" Grid.Column="2" Grid.Row="3" Style="{StaticResource LabelsOverlay}" Grid.ColumnSpan="3" Margin="5,0"/>

        <TextBox Name="SVRS_DaytimePhoneNumber2" Grid.Column="2" Grid.Row="4" Style="{StaticResource InputBoxes}" Grid.ColumnSpan="3" Uid="Elector" Margin="1" />
        <Label Content="Daytime Phone" Grid.Column="2" Grid.Row="4" Style="{StaticResource LabelsOverlay}" Grid.ColumnSpan="3" Margin="5,0"/>

        <ComboBox Name="SVRS_GenderTypeCode2" Grid.Row="5"  Style="{StaticResource ComboBoxes}" Uid="Elector"/>
        <Label Content="Gender" Grid.Row="5" Style="{StaticResource LabelsOverlay}"/>

        <TextBox Name="SVRS_DOB2" Grid.Column="1" Grid.Row="5"  Style="{StaticResource InputBoxes}" Uid="Elector" MaxLength="10" CharacterCasing="Upper" DataContext="{Binding}" LostFocus="SVRS_DOB_LostFocus" />
        <Label Content="DOB" Grid.Column="1" Grid.Row="5" Style="{StaticResource LabelsOverlay}"/>

        <TextBox Name="SVRS_EveningPhoneNumber2" Grid.Column="2" Grid.Row="5" Style="{StaticResource InputBoxes}" Grid.ColumnSpan="3" Uid="Elector" Margin="1" />
        <Label Content="Evening Phone" Grid.Column="2" Grid.Row="5" Style="{StaticResource LabelsOverlay}" Grid.ColumnSpan="3" Margin="5,0"/>

        <ComboBox Name="SVRS_Language2" Grid.Row="6"  Style="{StaticResource ComboBoxes}" Uid="Elector"/>
        <Label Content="Language" Grid.Row="6" Style="{StaticResource LabelsOverlay}"/>

        <TextBox Name="SVRS_EmailAddress2" Grid.Column="1" Grid.Row="6" Style="{StaticResource InputBoxes}" Grid.ColumnSpan="4" Uid="Elector" Margin="1" />
        <Label Content="email" Grid.Column="1" Grid.Row="6" Style="{StaticResource LabelsOverlay}" Grid.ColumnSpan="4" Margin="5,0"/>
    </Grid>
</TabItem>
</TabControl>
  • 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-26T07:50:38+00:00Added an answer on May 26, 2026 at 7:50 am

    If you mean that you want to generate these controls by code at runtime, then the following snippet will give you an idea:

            // Define grid with columns and rows
            var grid = new Grid();
            grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(113, GridUnitType.Star) });
            grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(55, GridUnitType.Star) });
            grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(13)});
            grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(24) });
    
            // Create each control and set its location
            var button = new Button { Name = "ButtonName", Content = "Button Content" };
            grid.Children.Add(button);
            Grid.SetColumn(button, 0);
            Grid.SetRow(button, 0);
    
            var textBox = new TextBox { Name= "TextBoxName"};
            grid.Children.Add(textBox);
            Grid.SetColumn(textBox, 1);
            Grid.SetRow(textBox, 0);
    
            // Create the tab control and add items
            var tabItem = new TabItem {Header = "Sample Header", Name = "TabName", Content = grid};
    
            var tabControl = new TabControl();
            tabControl.Items.Add(tabItem);
    
            MyWindow.AddChild(tabControl);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Zend_Form, how would I create form elements like this: <input type=text name=element[1] value=
I'm trying to dynamically create a form using JQuery. In order to do this,
I would like to create a form that changes dynamically. I have a form
I would like to create a form where a user can enter an arbitrary
I would like to create form based on dynamic parameters that are stored in
Below is some code that I'm using to create objects with Visual Basic: For
I would like create my own collection that has all the attributes of python
I would like create a web service in ASP.Net 2.0 that will supports JSON.
Would like to create a strong password in C++. Any suggestions? I assume it
I would like to create a database backed interactive AJAX webapp which has a

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.