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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:45:13+00:00 2026-05-22T01:45:13+00:00

I have a Custom UserControl . In that UserControl i have some buttons ,

  • 0

I have a Custom UserControl . In that UserControl i have some buttons , comboboxes , textboxses. When i use it in wpf application i want to be able to change button’s background and size… I have names for all the controls , but when i try to access them in wpf Application , i even cannot see them.

here is the user control –

<UserControl x:Class="MyUserControl.UserControl"
         Name="MyCustomUSerControl"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         d:DesignHeight="600" d:DesignWidth="620" Width="Auto" Height="Auto">
<Grid Width="Auto" Height="Auto" Background="LavenderBlush" x:Name="Grid_MainGrid">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <Expander Height="Auto" Width="Auto" Header="Filter" FontFamily="Arial Rounded MT">
        <Border CornerRadius="12" BorderThickness="2" Margin="5" BorderBrush="CornflowerBlue" Height="Auto" Width="Auto">
            <StackPanel Orientation="Horizontal" Height="Auto" Width="Auto" x:Name="StackPanel_ManinStackInExpander" >
                <StackPanel x:Name="StackPanel_Column" Height="Auto" Width="Auto" Margin="10,10,0,10">
                    <Label x:Name="Label_Column" Content="Column" Height="22" Width="70" Margin="0,0,0,0" HorizontalAlignment="Left" FontFamily="Rockwell" FontWeight="Normal"/>
                    <ComboBox x:Name="ComboBox_Columns" Background="Transparent" Height="Auto" Width="Auto" MinWidth="100" FontFamily="Bernard MT"/>
                    <Label x:Name="Label_Like" Content="Like" Height="22" Width="70" Margin="0,0,0,0" HorizontalAlignment="Left" FontFamily="Rockwell" FontWeight="Normal"/>
                    <TextBox Background="Transparent" Height="Auto" Width="Auto" FontFamily="Bernard MT" MinWidth="100" x:Name="TextBox_Like"/>
                    <StackPanel Orientation="Horizontal">
                        <StackPanel>
                            <Label x:Name="Label_Operation" Content="Operation" FontFamily="Rockwell"/>
                            <ComboBox x:Name="ComboBox_Operation" Background="Transparent" Width="50" HorizontalAlignment="Left" Margin="5,0,0,0">
                                <ComboBoxItem Content="&lt;"> </ComboBoxItem>
                                <ComboBoxItem Content=">"></ComboBoxItem>
                                <ComboBoxItem Content="="></ComboBoxItem>
                                <ComboBoxItem Content=">="></ComboBoxItem>
                                <ComboBoxItem Content="&lt;="></ComboBoxItem>
                                <ComboBoxItem Content="&lt;>"></ComboBoxItem>
                            </ComboBox>
                        </StackPanel>
                        <StackPanel Margin="10,0,0,0">
                            <Label Content="Value" x:Name="Label_Value" FontFamily="Rockwell"/>
                            <TextBox Background="Transparent" Width="Auto" Height="Auto"/>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
                <StackPanel Height="Auto" Width="Auto" Margin="10,10,0,10">
                    <Button x:Name="Button_AND" Background="LightGoldenrodYellow" Content="AND" Height="20" Width="70" Margin="10" FontFamily="Californian FB" FontWeight="Bold"/>
                    <Button x:Name="Button_OR" Background="LightGoldenrodYellow" Content="OR" Height="20" Width="70" Margin="10,0,10,10" FontFamily="Californian FB" FontWeight="Bold"/>
                </StackPanel>
                <ListView Margin="10" MinWidth="200" Background="Transparent" BorderThickness="1"></ListView>
                <StackPanel Margin="0,10,10,10">
                    <Button x:Name="Button_Enclose" Background="LightGoldenrodYellow" Width="120" Height="25" Margin="10" Content="(  )" FontFamily="Californian FB" FontWeight="Bold" FontSize="14"/>
                    <Button x:Name="Button_Filter" Background="LightGoldenrodYellow" Width="120" Height="25" Margin="10,45,10,0" Content="FIlter" FontFamily="Californian FB" FontWeight="Bold" FontSize="14"/>
                </StackPanel>
            </StackPanel>

        </Border>
    </Expander>
</Grid>

  • 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-22T01:45:13+00:00Added an answer on May 22, 2026 at 1:45 am

    When using C# add x:FieldModifier=”public” to the elements you want to expose.

    See this

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

Sidebar

Related Questions

I have a custom UserControl called (for instance) MyPanel, and I want to use
I have an custom UserControl that displays an image, i'm trying to use this
I have a custom control that inherits from UserControl , and I can't get
I have a simple user control that contains some buttons that fire events which
I have a custom UserControl with a function that updates the AutoScrollMinSize each time
I have so dinamically add some MyLabel s (custom WPF Controls) in MyUserControl (Custom
I have some custom cursors in my application. I used informations found on the
I have a nice little UserControl that is a draggable box with some text
I have a custom usercontrol that does a little animation on a DispatcherTimer tick,
I have a custom UserControl that I am drawing using the GDI+. It is

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.