Need help with custom controls


New member
Jun 27, 2019
Programming Experience
Hi, beginner here, so please be gentle.

I'm looking for someone to help create an application which has around 100 questions, and each question has a Yes/No radio button. If No is selected, there should be a textbox that shows up after no so you can type in comments. If yes is selected, the textbox should go away. Also, if you select no, the question (label) should turn red. I've created the custom control, but not sure how to assign name, eventhandlers. Please can someone help.

I'm looking to create something like this:

<ControlTemplate TargetType="{x:Type local:CustomControl1}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<GroupBox Name="GpBoxTopic1Question" Width="580">
<ColumnDefinition Width ="5*"/>
<ColumnDefinition Width ="*"/>
<ColumnDefinition Width ="*"/>
<ColumnDefinition Width ="*"/>
<TextBlock Text="This is question 1" Grid.Column="0" HorizontalAlignment="Left" Margin="0,0,-84,0" Grid.ColumnSpan="2" Grid.RowSpan="2" />
<RadioButton Grid.Column="1" Grid.Row="0" Content="Pass" HorizontalAlignment="Left" Margin="0,0,0,0"/>
<RadioButton Grid.Column="2" Grid.Row="0" Content="Fail" HorizontalAlignment="Left" Margin="0,0,0,0"/>
<TextBox Grid.Column="3" AcceptsReturn="True" TextWrapping="Wrap" SpellCheck.IsEnabled="True" Language="en-US" />

and have attached the full Generic.xaml file. Appreciate the help. Thanks


Top Bottom