wpf controls - Wpf button second click -


i wanna ask second button_click event. have grid on window. when click button, wanna grid visible , when second clicked button.i wanna grid hidden. windows start menu. codes follows. in advance.

    private void topics_click(object sender, routedeventargs e)     {          tgrid.visibility = visibility.hidden;     } 

why don't use current visibility determine whether hide or show it?

private void topics_click(object sender, routedeventargs e) {      tgrid.visibility = tgrid.visibility == visibility.hidden           ? visibility.visible : visibility.hidden; } 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -