Click here to Skip to main content
15,898,035 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: TreeView Control Item Styling Pin
SledgeHammer0113-Aug-12 10:25
SledgeHammer0113-Aug-12 10:25 
GeneralGroupbox visibility problem in WPF after debugging and changing the combobox value Pin
karthik bandaru8-Aug-12 23:24
karthik bandaru8-Aug-12 23:24 
GeneralRe: Groupbox visibility problem in WPF after debugging and changing the combobox value Pin
Ed Hill _5_9-Aug-12 0:06
Ed Hill _5_9-Aug-12 0:06 
GeneralRe: Groupbox visibility problem in WPF after debugging and changing the combobox value Pin
karthik bandaru9-Aug-12 0:23
karthik bandaru9-Aug-12 0:23 
GeneralRe: Groupbox visibility problem in WPF after debugging and changing the combobox value Pin
Ed Hill _5_9-Aug-12 0:31
Ed Hill _5_9-Aug-12 0:31 
GeneralRe: Groupbox visibility problem in WPF after debugging and changing the combobox value Pin
karthik bandaru9-Aug-12 0:42
karthik bandaru9-Aug-12 0:42 
GeneralRe: Groupbox visibility problem in WPF after debugging and changing the combobox value Pin
Ed Hill _5_9-Aug-12 0:56
Ed Hill _5_9-Aug-12 0:56 
GeneralRe: Groupbox visibility problem in WPF after debugging and changing the combobox value Pin
Ed Hill _5_9-Aug-12 0:47
Ed Hill _5_9-Aug-12 0:47 
if you are set on doing this in the code behind then i think i will need a better sample or your code to help you. The following is working for me:
XML
<StackPanel>
    <ComboBox Name="Options" SelectionChanged="SelectionChanged">
        <sys:String>One</sys:String>
        <sys:String>Two</sys:String>
        <sys:String>Three</sys:String>
    </ComboBox>
    <GroupBox Name="group1" Header="OneOrThree">
        
    </GroupBox>
    <GroupBox Name="group2" Header="Two">

    </GroupBox>
</StackPanel>

C#
private void SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    var selected = (sender as ComboBox).SelectedItem as String;
    switch (selected)
    {
        case "One":
            group1.Visibility = Visibility.Visible;
            group2.Visibility = Visibility.Collapsed;
            break;
        case "Two":
            group1.Visibility = Visibility.Collapsed;
            group2.Visibility = Visibility.Visible;
            break;
        case "Three":
            group1.Visibility = Visibility.Visible;
            group2.Visibility = Visibility.Collapsed;
            break;
        default:
            group1.Visibility = Visibility.Collapsed;
            group2.Visibility = Visibility.Collapsed;
            break;
    }
}


It would be worth throwing some checks in on the (sender as ComboBox) etc incase you call the event from the wrong place but i'll leave that to you to sort out
GeneralRe: Groupbox visibility problem in WPF after debugging and changing the combobox value Pin
karthik bandaru9-Aug-12 0:50
karthik bandaru9-Aug-12 0:50 
GeneralRe: Groupbox visibility problem in WPF after debugging and changing the combobox value Pin
karthik bandaru9-Aug-12 2:10
karthik bandaru9-Aug-12 2:10 
GeneralRe: Groupbox visibility problem in WPF after debugging and changing the combobox value Pin
Ed Hill _5_9-Aug-12 2:24
Ed Hill _5_9-Aug-12 2:24 
SuggestionRegarding MVVM framework for WPF Pin
Member 92251325-Aug-12 3:55
Member 92251325-Aug-12 3:55 
GeneralRe: Regarding MVVM framework for WPF Pin
Richard MacCutchan5-Aug-12 6:55
mveRichard MacCutchan5-Aug-12 6:55 
GeneralWPF Update UI When Collection Changes Pin
Kevin Marois1-Aug-12 11:05
professionalKevin Marois1-Aug-12 11:05 
GeneralRe: WPF Update UI When Collection Changes Pin
Pete O'Hanlon1-Aug-12 11:44
mvePete O'Hanlon1-Aug-12 11:44 
GeneralRe: WPF Update UI When Collection Changes Pin
Kevin Marois1-Aug-12 11:52
professionalKevin Marois1-Aug-12 11:52 
GeneralRe: WPF Update UI When Collection Changes Pin
Pete O'Hanlon1-Aug-12 12:10
mvePete O'Hanlon1-Aug-12 12:10 
GeneralRe: WPF Update UI When Collection Changes Pin
Kevin Marois1-Aug-12 12:23
professionalKevin Marois1-Aug-12 12:23 
GeneralRe: WPF Update UI When Collection Changes Pin
Pete O'Hanlon1-Aug-12 12:45
mvePete O'Hanlon1-Aug-12 12:45 
GeneralRe: WPF Update UI When Collection Changes Pin
Kevin Marois1-Aug-12 12:51
professionalKevin Marois1-Aug-12 12:51 
GeneralRe: WPF Update UI When Collection Changes Pin
Mycroft Holmes1-Aug-12 13:10
professionalMycroft Holmes1-Aug-12 13:10 
GeneralRe: WPF Update UI When Collection Changes Pin
Kevin Marois1-Aug-12 13:27
professionalKevin Marois1-Aug-12 13:27 
GeneralRe: WPF Update UI When Collection Changes Pin
Kevin Marois6-Aug-12 7:25
professionalKevin Marois6-Aug-12 7:25 
GeneralRe: WPF Update UI When Collection Changes Pin
Mycroft Holmes6-Aug-12 12:38
professionalMycroft Holmes6-Aug-12 12:38 
GeneralRe: WPF Update UI When Collection Changes Pin
SledgeHammer011-Aug-12 13:15
SledgeHammer011-Aug-12 13:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.