Sign in to follow this  
Followers 0
zackrspv

Control Object Move

4 posts in this topic

Have a piece of code that works when the .BorderStyle = 1, but not when .BorderStyle = 0.

I do not want my embeded richtext box to show a border, when i have it in my master program, but if i set BorderStyle to 0, while the border is gone, u can't move, resize the object.

Example:

#include <GUIConstantsEx.au3>

$form = GUICreate("Very Basic RTF Editor", 300, 300)
GUISetBkColor(0x444444)
$oRP = ObjCreate("RICHTEXT.RichtextCtrl.1")
$guiobject = GUICtrlCreateObj($oRP, 0, 0, 10, 10)

With $oRP; Object tag pool
    .OLEDrag()
    .Font = 'Arial'
    .SelColor = 0xFFFFFF
    .BackColor = 0x444444   
    .Enabled = True
    .Locked = False 
    .SelProtected = 0
    .AutoVerbMenu = True
EndWith
GUISetState();Show GUI

MsgBox(0, "Good", "With .BorderStyle = 1", 10)
$oRP.BorderStyle = 1
GUICtrlSetPos($guiobject, 0, 0, 100, 100)
Sleep(350)
GUICtrlSetPos($guiobject, 0, 0, 200, 200)
Sleep(350)
GUICtrlSetPos($guiobject, 0, 0, 300, 300)
MsgBox(0, "Good", "With .BorderStyle = 0", 10)
$oRP.BorderStyle = 0
GUICtrlSetPos($guiobject, 0, 0, 100, 100)
Sleep(350)
GUICtrlSetPos($guiobject, 0, 0, 200, 200)
Sleep(350)
GUICtrlSetPos($guiobject, 0, 0, 300, 300)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd
GUIDelete()

If you simply run that, u'll see :D

How can i resolve this?


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites



This is just a hack... It might not be what you're looking for.

Perhaps someone who knows more about RichEdit can help you further.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$form = GUICreate("Very Basic RTF Editor", 300, 300,Default,Default, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
GUISetBkColor(0x444444)
$oRP = ObjCreate("RICHTEXT.RichtextCtrl.1")
$guiobject = GUICtrlCreateObj($oRP, -3, -3, 306, 306)
GUICtrlSetResizing($guiobject, $GUI_DOCKBORDERS)

With $oRP; Object tag pool
    .OLEDrag()
    .Font = 'Arial'
    .SelColor = 0xFFFFFF
    .BackColor = 0x444444
    .Enabled = True
    .Locked = False    
    .SelProtected = 0
    .AutoVerbMenu = True
    .BorderStyle=1
EndWith

GUISetState();Show GUI

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd
GUIDelete()

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

This is just a hack... It might not be what you're looking for.

Perhaps someone who knows more about RichEdit can help you further

Problem still exists tho;

With .BorderStyle = 0 specified, still cannot move or resize the control.


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

With .BorderStyle = 0 specified, still cannot move or resize the control.

Upon further inspection, there's another control in play that needs to be resized as well.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$form = GUICreate("Very Basic RTF Editor", 300, 300,Default,Default, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
GUISetBkColor(0x444444)
$oRP = ObjCreate("RICHTEXT.RichtextCtrl.1")
$guiobject = GUICtrlCreateObj($oRP, 0, 0, 300, 300)

With $oRP; Object tag pool
    .OLEDrag()
    .Font = 'Arial'
    .SelColor = 0xFFFFFF
    .BackColor = 0x444444
    .Enabled = True
    .Locked = False   
    .SelProtected = 0
    .AutoVerbMenu = True
    .BorderStyle=0
EndWith

GUISetState();Show GUI

Sleep(1000)
GUICtrlSetPos($guiobject, 0,0,100,100)
ControlMove($form,"", "CtlFrameWork_ReflectWindow1", 0,0,100,100)
Sleep(1000)
GUICtrlSetPos($guiobject, 0,0,200,200)
ControlMove($form,"", "CtlFrameWork_ReflectWindow1", 0,0,300,300)
Sleep(1000)
GUICtrlSetPos($guiobject, 0,0,300,300)
ControlMove($form,"", "CtlFrameWork_ReflectWindow1", 0,0,300,300)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd
GUIDelete()
Again, still a hack.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

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