Jump to content

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 )
#endregion

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

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

#region  Create GUI
$main = GUICreate("Messenger", 545, 450, 195, 117)
GUISetBkColor( $BkColor )
;Menu
$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
.OLEDrag()
.Font = $fontColor
.Text = ""
.BackColor = $textBackColor
;.FontColor = $txtColor
EndWith


GUISetState(@SW_SHOW)
#endregion

$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 )
    EndSwitch
WEnd

#region  Functions

#endregion
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...