Jump to content
Sign in to follow this  

Richtext object help

Recommended Posts


Ok, so im trying to make an online messenger program like AIM/MSN Instant Messenger (I know this has been done before...). I've been searching, but i can't find answers to any of my questions:

  • Why wont my Richtextobject wont change size?
  • What are all of richtext.richtextctrl.1's properties that I can use?
What i want is a box that will show formatted text to the user while they are typing, that they can format differently with buttons i will later add.

Thanks for any help, and heres my current code:

; Online chat - Gcommer

#region   Includes
#include <GUIConstants.au3>
#include <Misc.au3>
#include <IE.au3>
Opt( "TrayMenuMode", 3 )

#region  Variables
Global $msg = 0
;User settings
Global $txtColor = 0x000000
$BkColor = 0x000000
$fontColor = 0xFFFFFF
$textBackColor = 0x000000

#region  Create Tray Menu
$openMess = TrayCreateItem("Open Messenger")
TrayItemSetState( -1, 512 )
$trayExit = TrayCreateItem("Exit")
$signOff = TrayCreateItem("Sign Off")

#region  Create GUI
$main = GUICreate("Messenger", 545, 450, 195, 117)
GUISetBkColor( $BkColor )
$file = GUICtrlCreateMenu("File")
$menuExit = GUICtrlCreateMenuItem("Exit", $file)
$options = GUICtrlCreateMenu("Options")
$color = GUICtrlCreateMenuItem("Background Colors", $options)
$help = GUICtrlCreateMenu("Help")
$about = GUICtrlCreateMenuItem("About...", $help)
;Chat box
$chatIE = _IECreateEmbedded( )
$chatBox = GUICtrlCreateObj( $chatIE, 5, 5, 530, 310 )
_IENavigate( $chatIE, "about:blank" )
_IEBodyWriteHTML($chatIE, "<font color=#0000ff size=4 face=""arial black"">Welcome to My Chat!</font><br>")
;Text box
$rchTxt = ObjCreate("RICHTEXT.RichtextCtrl.1")
$typeBox = GUICtrlCreateObj( $rchTxt, 5, 320, 530, 120 )
With $rchTxt
.Font = $fontColor
.Text = ""
.BackColor = $textBackColor
;.FontColor = $txtColor


$msg = GUIGetMsg()
While $msg <> $GUI_EVENT_CLOSE AND $msg <> $menuExit AND $msg <> $trayExit
    $msg = GUIGetMsg()
    Switch $msg
        Case $msg = $about
        Case $msg = $color
            $BkColor = _ChooseColor(2, $BkColor, 2)
            GUISetBkColor( $BkColor )

#region  Functions


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.