Hiding Controls

Started by Anthony Billingsley, May 03, 2013, 01:34:56 AM

Previous topic - Next topic

Anthony Billingsley

Though I'm not new to programming, I have only been working with PowerBASIC for about 3 months and FireFly for about 2 days.  My questions are about hiding controls.  I have a test form with two buttons.  When I click button one I want it to hide button two.   Below is my code snippet.  My code compiles but doesn’t work.   My second question is how to hide controls at form creation.  I thought I should put the hide command in the form's WM_CREATE function, but that didn’t work either.  I have tried searching the forums, but could not find an answer.  I know the answer is simple, but I can't seem to see it.  Guidance would be most appreciated.

Function MAIN_COMMAND1_BN_CLICKED ( _
                                   ControlIndex     As Long,  _  ' index in Control Array
                                   hWndForm         As Dword, _  ' handle of Form
                                   hWndControl      As Dword, _  ' handle of Control
                                   idButtonControl  As Long   _  ' identifier of button
                                   ) As Long
                                   
Control Hide hWndForm, IDC_MAIN_COMMAND2

   
End Function

José Roca

Don't use DDT statements winth FireFly.

ShowWindow(GetDlgItem(hWndForm, %IDC_MAIN_COMMAND2), %SW_HIDE)

Klaas Holland

    FF_Control_ShowState HWND_FORM1_COMMAND2, %SW_HIDE

Paul Squires

Quote from: Anthony Billingsley on May 03, 2013, 01:34:56 AM
... My second question is how to hide controls at form creation.  I thought I should put the hide command in the form's WM_CREATE function, but that didn’t work either.  I have tried searching the forums, but could not find an answer.  I know the answer is simple, but I can't seem to see it.  Guidance would be most appreciated.
You can uncheck the WS_VISIBLE style for the control found unter "WindowStyles".
Paul Squires
PlanetSquires Software

Anthony Billingsley

Thank you to everyone for your help and quick replies.

Paul, FF is a joy to use and I am 110% satisified with my purchase.

Tony

Paul Squires

Quote from: Anthony Billingsley on May 03, 2013, 08:57:20 PM
Thank you to everyone for your help and quick replies.

Paul, FF is a joy to use and I am 110% satisified with my purchase.

Tony

That's awesome to hear Tony! Thanks for your support too. FireFly users are amazing.  :)
Paul Squires
PlanetSquires Software