aekschnuschi Posted April 22, 2007 Share Posted April 22, 2007 hmm,.. dont know if this prob has been ever solved - but i looked and searched a long time in this forum - but dont found anything,.. OK,..my problem: i have a .txt file with a large text. i want to scroll in this label - but it doesnt work - why? CODE $text=FileRead("startseite.txt") GUICtrlCreateLabel ($text, 230, 135, 530,440,$ES_AUTOVSCROLL+$WS_VSCROLL) hmmm,... i solved it with an inputbox: CODE $text=FileRead("startseite.txt") GUICtrlCreateEdit ($text, 230, 135, 510,440,BitOR($ES_READONLY, $WS_VSCROLL, $ES_MULTILINE)) can i deactivate the Cursor? Link to comment Share on other sites More sharing options...
Sokko Posted April 22, 2007 Share Posted April 22, 2007 There's no getting rid of the cursor, and I don't think labels can ever scroll in the first place, though you can put scrollbars on them visually. Even Windows Update on 2000 and XP uses a read-only edit box for the installation log, and the cursor is indeed visible. Or next time you use one of those "wizard" installers, check the license agreement page and I'll bet you can see a cursor if you click in the text area (you might also see it in the list of files that are being installed). It's really not a big deal, and it also allows you to select and copy the text. Link to comment Share on other sites More sharing options...
xcal Posted April 22, 2007 Share Posted April 22, 2007 (edited) There's no getting rid of the cursor... #include <GUIConstants.au3> GUICreate('', 200, 200) GUICtrlCreateEdit('Mouse over this...', 50, 50, 100, 100, $SS_BLACKFRAME) GUICtrlSetCursor(-1, 16) GUISetState() While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd Edited April 22, 2007 by xcal How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Sokko Posted April 22, 2007 Share Posted April 22, 2007 (edited) I was talking about the text cursor. You know, the little blinking vertical line that marks your place in an edit box. I think it would be quite odd to remove the mouse cursor from Aekschnuschi's edit box (especially since it would make manipulating the scrollbars rather difficult). Edited April 22, 2007 by Sokko Link to comment Share on other sites More sharing options...
xcal Posted April 22, 2007 Share Posted April 22, 2007 ok How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
xcal Posted April 22, 2007 Share Posted April 22, 2007 (edited) There's no getting rid of the cursor... #include <GUIConstants.au3> $hidden = False $gui = GUICreate('My Hide Caret', 200, 200) $edit = GUICtrlCreateEdit('Here is my edit box with no caret!', 50, 50, 100, 100, $ES_READONLY) GUISetState() While 1 If WinActive('My Hide Caret') And Not $hidden Then DllCall('user32.dll', 'int', 'DestroyCaret') $hidden = True ; this so it's not called over and over EndIf If Not WinActive('My Hide Caret') Then $hidden = False If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd Edited April 22, 2007 by xcal How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
therks Posted April 22, 2007 Share Posted April 22, 2007 Heh, I guess you showed him. I would have said the same as him though, never thought you'd be able to get rid of the caret. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
xcal Posted April 23, 2007 Share Posted April 23, 2007 Heh, I guess you showed him. I would have said the same as him though, never thought you'd be able to get rid of the caret.Haha I didn't figure it out to show him up. I tried to find the answer to challenge myself. How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Sokko Posted April 23, 2007 Share Posted April 23, 2007 (edited) DestroyCaret, eh? Never would have thought. Looking at MSDN it appears you're only supposed to call it when your window is about to lose keyboard focus, so I guess this is sort of an unintended bonus. Might even come in handy for a project I'm working on right now. Nice work! Edited April 23, 2007 by Sokko Link to comment Share on other sites More sharing options...
xcal Posted April 23, 2007 Share Posted April 23, 2007 (edited) Well, there actually are Hide/ShowCaret functions. I was just destroying. I guess this is more 'proper.' #include <GUIConstants.au3> $hidden = False GUICreate('My Hide Caret', 220, 180) $edit = GUICtrlCreateEdit('Here is my edit box caret example!', 20, 20, 180, 100, $ES_READONLY) $btn1 = GUICtrlCreateButton('Show Caret', 20, 140, 80, 26) $btn2 = GUICtrlCreateButton('Hide Caret', 120, 140, 80, 26) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $btn1 DllCall('user32.dll', 'int', 'ShowCaret', 'hwnd', '') GUICtrlSetState($edit, $GUI_FOCUS) Case $btn2 GUICtrlSetState($edit, $GUI_FOCUS) DllCall('user32.dll', 'int', 'HideCaret', 'hwnd', '') EndSwitch WEnd Edited April 23, 2007 by xcal Professor_Bernd 1 How To Ask Questions The Smart Way 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