Page 1 of 1

Style WS_TABSTOP

Posted: Sat Aug 06, 2022 6:24 am
by Jimmy
hi,

it seems all Control have default Style WS_TABSTOP.

when have e.g. XIMAGE or ActiveX it "TabStop" when press "TAB" and Control got Focus

but when have TGET, TCOMBOBOX in same Form i like to have WS_TABSTOP only on Control which can "change" (User Action) Result.

is there a (easy) Method to change ::style of Control :?:

Re: Style WS_TABSTOP

Posted: Sat Aug 06, 2022 12:13 pm
by nageswaragunupudi

Code: Select all | Expand

oControl:SetStyle( WS_TABSTOP,  .T.  or .F. )

Re: Style WS_TABSTOP

Posted: Sat Aug 06, 2022 7:58 pm
by Jimmy
hi,
nageswaragunupudi wrote:

Code: Select all | Expand

oControl:SetStyle( WS_TABSTOP,  .T.  or .F. )

Thx for Advice.

it work for XBROWSE but crash at XIMAGE or ActiveX

Re: Style WS_TABSTOP

Posted: Sun Aug 07, 2022 6:36 pm
by nageswaragunupudi
Not possible.
Please give a small sample with ximage.

Re: Style WS_TABSTOP

Posted: Tue Aug 09, 2022 1:16 am
by Jimmy
hi,

try this

Code: Select all | Expand

#include "fivewin.ch"

PROCEDURE Main()
LOCAL oDlg, oFont, oImage
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 12
   DEFINE WINDOW oDlg FROM 0, 0 TO 600, 800 + 16 PIXEL TITLE "TVIP " COLOR RGB(025,254,255), CLR_BLACK

      @ 310, 330 XIMAGE oImage SIZE 64, 64 OF oDlg                    // NOBORDER
      oImage:lBmpTransparent := .F.
      oImage:bLDblClick := { || MsgInfo( "Hello World" ) }
      // Crash here
      oImage:SetStyle( WS_TABSTOP, .F. )

   ACTIVATE WINDOW oDlg CENTERED
RETURN

or this

Code: Select all | Expand

  iMax := LEN(oObj:aControls)
   FOR ii := 1 TO iMax
     oControl := oObj:aControls[ii]
      DO CASE
         CASE "TSAY"       $ oControl:ClassName()
              * oControl:SetStyle( WS_TABSTOP, .F. ) // crash
         CASE "TGET"       $ oControl:ClassName()

         CASE "FWTVLC"     $ oControl:ClassName()
               * oControl:SetStyle( WS_TABSTOP, .F. ) // crash
         CASE "TXBROWSE"   $ oControl:ClassName()
               oControl:SetStyle( WS_TABSTOP, .F. )   // work
         CASE "TXIMAGE"    $ oControl:ClassName()
               * oControl:SetStyle( WS_TABSTOP, .F. ) // crash
         CASE "TRADIO"     $ oControl:ClassName()
               * oControl:SetStyle( WS_TABSTOP, .F. ) // crash
         CASE "TBUTTON"    $ oControl:ClassName()
               oControl:SetStyle( WS_TABSTOP, .F. )   // work
         CASE "TBTNBMP"    $ oControl:ClassName()
              * oControl:SetStyle( WS_TABSTOP, .F. )  // crash
      ENDCASE

Error description: Error BASE/1004 Message not found: TXIMAGE:SETSTYLE

Re: Style WS_TABSTOP

Posted: Tue Aug 09, 2022 2:40 pm
by nageswaragunupudi
Extremely sorry for my typo.

The method is WinStyle, not SetStyle

Code: Select all | Expand

oControl:WinStyle( WS_TABSTOP,  .T.  or .F. )

Re: Style WS_TABSTOP

Posted: Tue Aug 09, 2022 7:03 pm
by Jimmy
hi,
nageswaragunupudi wrote:The method is WinStyle, not SetStyle

Code: Select all | Expand

oControl:WinStyle( WS_TABSTOP,  .T.  or .F. )

Thx for Answer.

Yes, this work now :D