Results 1 to 6 of 6

Thread: Show/Hide panels, buttons, listbox... only in project ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2014
    Posts
    117

    Show/Hide panels, buttons, listbox... only in project ?

    Whether it is possible to hide/show panels, buttons, listbox only in project ?
    I have a small form with a lot of buttons, with 2-3 panels ... and working in this environment is impossible because i don't need all buttons, panels at same time ?

    Thanks,

  2. #2
    Frenzied Member Bulldog's Avatar
    Join Date
    Jun 2005
    Location
    South UK
    Posts
    1,950

    Re: Show/Hide panels, buttons, listbox... only in project ?

    Most controls have a .Visible property, so at runtime you could hide controls which are not relevant at any given time. They will always show on the designer. Is that what you meant?


    • If my post helped you, please Rate it
    • If your problem is solved please also mark the thread resolved

    I use VS2015 (unless otherwise stated).
    _________________________________________________________________________________
    B.Sc(Hons), AUS.P, C.Eng, MIET, MIEEE, MBCS / MCSE+Sec, MCSA+Sec, MCP, A+, Net+, Sec+, MCIWD, CIWP, CIWA
    I wrote my very first program in 1979, using machine code on a mechanical Olivetti teletype connected to an 8-bit, 78 instruction, 1MHz, Motorola 6800 multi-user system with 2k of memory. Using Windows, I dont think my situation has improved.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2014
    Posts
    117

    Re: Show/Hide panels, buttons, listbox... only in project ?

    No. I want to hide in designer ?

  4. #4
    Frenzied Member Bulldog's Avatar
    Join Date
    Jun 2005
    Location
    South UK
    Posts
    1,950

    Re: Show/Hide panels, buttons, listbox... only in project ?

    I don't think it's possible to do that. If you have a lot of controls on one form, you might want to consider breaking them into sub-groups and perhaps using a tab control.


    • If my post helped you, please Rate it
    • If your problem is solved please also mark the thread resolved

    I use VS2015 (unless otherwise stated).
    _________________________________________________________________________________
    B.Sc(Hons), AUS.P, C.Eng, MIET, MIEEE, MBCS / MCSE+Sec, MCSA+Sec, MCP, A+, Net+, Sec+, MCIWD, CIWP, CIWA
    I wrote my very first program in 1979, using machine code on a mechanical Olivetti teletype connected to an 8-bit, 78 instruction, 1MHz, Motorola 6800 multi-user system with 2k of memory. Using Windows, I dont think my situation has improved.

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Show/Hide panels, buttons, listbox... only in project ?

    You can't hide them in the designer, that would defeat the purpose. What you can do is either use the tab control as Bulldog suggested, or if the controls are already grouped onto panels, you can move the panels out of the visible window. You'd have to bring them back in at runtime via code, though, or else they wouldn't show on the form.

    Normally, this isn't an issue, because an excess of controls generally means that something is wrong with the design, but there are some cases where it makes sense. Usually, these cases are where one large control, such as a big panel or picturebox, dominates the area of the form, though it is sometimes either hidden, or moved, in code. In such cases, the panel can be created quite small for design time, and only expanded to its ultimate size at runtime.
    My usual boring signature: Nothing

  6. #6
    Frenzied Member Bulldog's Avatar
    Join Date
    Jun 2005
    Location
    South UK
    Posts
    1,950

    Re: Show/Hide panels, buttons, listbox... only in project ?

    It just occurred to me that you could also use a SplitContainer and partition up the form controls for that. At design time you can widen the container split which will serve to hide the controls on a given panel(s), at run time you can restore the split to be correct. You'd have to be careful with the layout/position of controls and keep checking the runtime 'look'.

    But following what Shaggy said, if you're having problems with the amount of controls at design time, I would also imagine your users will have similar problems. So it tends to suggest something is wrong with how your controls are laid out. It often helps to move anything 'settings' related onto a dedicated tab, panel etc.


    • If my post helped you, please Rate it
    • If your problem is solved please also mark the thread resolved

    I use VS2015 (unless otherwise stated).
    _________________________________________________________________________________
    B.Sc(Hons), AUS.P, C.Eng, MIET, MIEEE, MBCS / MCSE+Sec, MCSA+Sec, MCP, A+, Net+, Sec+, MCIWD, CIWP, CIWA
    I wrote my very first program in 1979, using machine code on a mechanical Olivetti teletype connected to an 8-bit, 78 instruction, 1MHz, Motorola 6800 multi-user system with 2k of memory. Using Windows, I dont think my situation has improved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width