Sign in to follow this  
Followers 0
layer

GUI Edit Styles... Not updating

5 posts in this topic

#1 ·  Posted (edited)

Hey guys :P I've got a problem, and I've got a script to reproduce it... I'm sure the solution is under my nose... But I can't see it ! ;) So I've come to the forums...

Basically, my GUI edit styles aren't updating. In the example below, if you type until the border, the text should auto scroll to the next line, like word wrap, and it does. But then, click the button "Click", and the text should stop auto scrolling, and just go past the border... But it continues to word wrap even though I added auto scrolling styles ! Here is the example...:

; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("MyGUI", 392, 323,(@DesktopWidth-392)/2, (@DesktopHeight-323)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Edit_1 = GuiCtrlCreateEdit("", 20, 60, 330, 200, BitOr($ES_WANTRETURN, $ES_MULTILINE, $WS_TABSTOP))
$Button_2 = GuiCtrlCreateButton("Click", 50, 20, 80, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $button_2
        GUICtrlSetStyle($edit_1, BitOr($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_MULTILINE, $WS_TABSTOP))
    EndSelect
WEnd
Exit

The answer is probably right there... OR has been asked a million times, but I just need some help this time...

Cheers

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites



Thanks CS, I'll look into that. I'll see if there is a message or DllCall to be used... If not, I guess I could read the contents of the control, delete it, make the new control with new styles, and set the data... Kind of sloppy, but it may be the only solution.

Thanks ;)


FootbaG

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks CS, I'll look into that. I'll see if there is a message or DllCall to be used... If not, I guess I could read the contents of the control, delete it, make the new control with new styles, and set the data... Kind of sloppy, but it may be the only solution.

Thanks ;)

Const $SWP_NOMOVE = 0x0002, $SWP_NOSIZE = 0x0001, $SWP_NOZORDER = 0x0004, $SWP_FRAMECHANGED = 0x0020;from Winuser.h
DllCall("user32.dll", "long", "SetWindowPos", "hwnd", $yourhWnd, "hwnd", $yourhWnd, "int", 0, "int", 0, "int", 0, "int", 0, _
"long", BitOR($SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOZORDER, $SWP_FRAMECHANGED))

I use this to update the control or window after altering styles/exstyles

Edited by quaizywabbit

[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

Alrighty, I couldn't get your example to work with my script quaizywabbit... So I used the idea I had after CyberSlug had posted... And I'm satisfied ;)

Thanks for the help !


FootbaG

Share this post


Link to post
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
Sign in to follow this  
Followers 0