Gcommer Posted April 19, 2007 Posted April 19, 2007 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:expandcollapse popup; 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
Zedna Posted April 19, 2007 Posted April 19, 2007 Try to search in this forum for RichtextThere are many posts about this ... Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted April 19, 2007 Posted April 19, 2007 (edited) [*]Why wont my Richtextobject wont change size? Try to catch WM_SIZE and resize there your control: Const $WM_SIZE = 0x05 GUIRegisterMsg($WM_SIZE, "MY_WM_SIZE") Func MY_WM_SIZE() ; resize what you want here ... Return $GUI_RUNDEFMSG EndFunc Edited April 19, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
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