PhoenixXL Posted August 9, 2012 Share Posted August 9, 2012 (edited) 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 August 9, 2012 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 More sharing options...
UEZ Posted August 9, 2012 Share Posted August 9, 2012 (edited) Look at _GUIScrollBars_SetScrollInfo() function.Something like that here:expandcollapse popup#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_RemoveScrollBarsBr,UEZ Edited August 9, 2012 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 More sharing options...
PhoenixXL Posted August 9, 2012 Author Share Posted August 9, 2012 I guess you are referring to the Redraw parameter I have tried that but nothing just happens expandcollapse popup#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 More sharing options...
LarsJ Posted August 10, 2012 Share Posted August 10, 2012 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 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
PhoenixXL Posted August 11, 2012 Author Share Posted August 11, 2012 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now