PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Jean-pierre Leroy on May 10, 2015, 07:37:18 AM

Title: How do you disable the Tab stop for a control at run-time
Post by: Jean-pierre Leroy on May 10, 2015, 07:37:18 AM
Dear all,

Is-it possible to disable Tab stop (%WS_TABSTOP style) for a control at run time ?

Thanks,
Jean-Pierre

Title: Re: How do you disable the Tab stop for a control at run-time
Post by: Jean-pierre Leroy on May 10, 2015, 08:21:00 AM
I found the answer myself in the forum, thanks to Mark.

http://www.planetsquires.com/protect/forum/index.php?topic=904.msg8945#msg8945

For my particular needs, I created these two functions:


Sub TextBoxResetReadOnlyAndNoTabStop(ByVal hWndControl As Dword)
   FF_TextBox_SetText (hWndControl, "")
   SendMessage        (hWndControl, %EM_SETREADONLY, %TRUE , 0)
   FF_Control_SetColor(hWndControl, &H00000000     , &HF0F0F0)
   SetWindowLong      (hWndControl, %GWL_STYLE, GetWindowLong(hWndControl, %GWL_STYLE) And (Not %ws_tabstop))   
End Sub



Sub TexBoxNoReadOnlyAndTabStop(ByVal hWndControl As Dword)
   SendMessage        (hWndControl, %EM_SETREADONLY, %FALSE, 0)
   FF_Control_SetColor(hWndControl, &H00000000     , &H00FFFFFF)
   SendMessage        (hWndControl, %EM_SETREADONLY, %FALSE, 0)
   SetWindowLong      (hWndControl, %GWL_STYLE, GetWindowLong(hWndControl, %GWL_STYLE) Or %ws_tabstop)   
End Sub


Regards,
Jean-Pierre