Jump to content

Destroy Edit Scroll Bar


 Share

Recommended Posts

Hi

Thisz the code,

#include <WinAPI.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>$hGUI = GUICreate('')
Local $Edit = GUICtrlCreateEdit('', 10, 10, 200, 120)
Local $_Handle=GUICtrlGetHandle($Edit)
Local $Style=_CtrlGetStyle($_Handle)
ConsoleWrite(_CtrlSetStyle($_Handle,_RemoveBit($Style,BitOR($WS_VSCROLL, $WS_HSCROLL)))&@CR)
GUISetState()

Local $iGUIGetMsg
While 1
$iGUIGetMsg = GUIGetMsg()
Switch $iGUIGetMsg
Case -3
ExitLoop
EndSwitch
WEnd

Func _CtrlSetStyle($hControl_hWnd,$Style)
Return _WinAPI_SetWindowLong($hControl_hWnd,0xFFFFFFF0,$Style)
EndFunc ;==>GUICtrlGetStyle

Func _CtrlGetStyle($hControl_hWnd)
Return _WinAPI_GetWindowLong($hControl_hWnd,0xFFFFFFF0)
EndFunc ;==>GUICtrlGetStyle

Func _RemoveBit($Original_Bits, $_ToRemove)
If BitAND($Original_Bits, $_ToRemove) Then
Return BitXOR($Original_Bits, $_ToRemove)
Else
Return SetExtended(1,$Original_Bits)
EndIf
EndFunc ;==>_RemoveBit

It makes an Edit Control with Default Styles and then Deletes the Scroll Bar style from it.

The Scroll bar disappears but the place would be still colored Blue

Is there Anyway to make the Blue color again White (or the color of the Edit/RichEdit)

Thanks for the Help

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

Look at _GUIScrollBars_SetScrollInfo() function.

Something like that here:

#include <ScrollBarConstants.au3>
#include <GuiScrollBars.au3>
#include <WinAPI.au3>;~~~
#include <EditConstants.au3>;~~~
#include <WindowsConstants.au3>
$hGUI = GUICreate('');~~~
Local $Edit = GUICtrlCreateEdit('', 10, 10, 200, 120, $ES_AUTOHSCROLL + $ES_AUTOVSCROLL + $ES_WANTRETURN)
Local $_Handle=GUICtrlGetHandle($Edit)
Local $Style=_CtrlGetStyle($_Handle)
;~ ConsoleWrite(_CtrlSetStyle($_Handle,_RemoveBit($Style,BitOR($WS_VSCROLL, $WS_HSCROLL)))&@CR)
_RemoveScrollBars($_Handle)
GUISetState()


Local $iGUIGetMsg
While 1
$iGUIGetMsg = GUIGetMsg()
Switch $iGUIGetMsg
Case -3
ExitLoop
EndSwitch
WEnd

Func _CtrlSetStyle($hControl_hWnd,$Style)
Return _WinAPI_SetWindowLong($hControl_hWnd,0xFFFFFFF0,$Style)
EndFunc ;==>GUICtrlGetStyle

Func _CtrlGetStyle($hControl_hWnd)
Return _WinAPI_GetWindowLong($hControl_hWnd,0xFFFFFFF0)
EndFunc ;==>GUICtrlGetStyle

Func _RemoveBit($Original_Bits, $_ToRemove)
If BitAND($Original_Bits, $_ToRemove) Then
Return BitXOR($Original_Bits, $_ToRemove)
Else
Return SetExtended(1,$Original_Bits)
EndIf
EndFunc ;==>_RemoveBit




Func _RemoveScrollBars($hWnd, $horz = True, $vert = True)
    Local $tSCROLLINFO = DllStructCreate($tagSCROLLINFO)
    DllStructSetData($tSCROLLINFO, "fMask", BitOR($SIF_RANGE, $SIF_PAGE))
    DllStructSetData($tSCROLLINFO, "nMin", 0)
    DllStructSetData($tSCROLLINFO, "nMax", 0)
    DllStructSetData($tSCROLLINFO, "nPage", 0)
    If $vert Then _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
    If $horz Then _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO)
EndFunc   ;==>_Functions_RemoveScrollBars

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

I guess you are referring to the Redraw parameter

I have tried that but nothing just happens

#include <WinAPI.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <GuiScrollBars.au3>
#include <ScrollBarConstants.au3>
$hGUI = GUICreate('')
Local $Edit = GUICtrlCreateEdit('', 10, 10, 200, 120)
Local $_Handle=GUICtrlGetHandle($Edit)
Local $Style=_CtrlGetStyle($_Handle)
ConsoleWrite(_CtrlSetStyle($_Handle,_RemoveBit($Style,BitOR($WS_VSCROLL, $WS_HSCROLL)))&@CR)
_GUIScrollBars_SetScrollInfo($_Handle,Default,Default,1)
GUISetState()

Local $iGUIGetMsg
While 1
$iGUIGetMsg = GUIGetMsg()
Switch $iGUIGetMsg
Case -3
ExitLoop
EndSwitch
WEnd

Func _CtrlSetStyle($hControl_hWnd,$Style)
Return _WinAPI_SetWindowLong($hControl_hWnd,0xFFFFFFF0,$Style)
EndFunc ;==>GUICtrlGetStyle

Func _CtrlGetStyle($hControl_hWnd)
Return _WinAPI_GetWindowLong($hControl_hWnd,0xFFFFFFF0)
EndFunc ;==>GUICtrlGetStyle

Func _RemoveBit($Original_Bits, $_ToRemove)
If BitAND($Original_Bits, $_ToRemove) Then
Return BitXOR($Original_Bits, $_ToRemove)
Else
Return SetExtended(1,$Original_Bits)
EndIf
EndFunc ;==>_RemoveBit

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

Here is a simple solution:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ScrollBarConstants.au3>
#include <GuiScrollBars.au3>
#include <GuiEdit.au3>

Opt( "MustDeclareVars", 1 )
MainProgram()
Func MainProgram()
Local $iLinesPrPage = 10
Local $height = $iLinesPrPage * 13 + 6
Local $hGui = GUICreate( "Edit", 400, $height+20, 500, 200 )
Local $idEdit = GUICtrlCreateEdit( "", 10, 10, 380, $height, $ES_WANTRETURN+$WS_VSCROLL )
Local $hEdit = GUICtrlGetHandle( $idEdit )
_GUIScrollBars_ShowScrollBar($hEdit, $SB_VERT, False)
_GUIScrollBars_ShowScrollBar($hEdit, $SB_HORZ, False)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndFunc
Link to comment
Share on other sites

Thanks,

both the solution works as required :)

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...