2012-12-27 30 views
1

我再次向所有人致敬,當然,在編碼時還有另一個問題。如何在delphi程序中調用TRichEdit方法

我寫了下面的代碼片段:

procedure add_text(text : String); 
begin 
    MsgBox.SetFocus; 
    MsgBox.SelStart := MsgBox.GetTextLen; 
    MsgBox.Perform(EM_SCROLLCARET, 0, 0); 
    MsgBox.SelText := time_stamp + ' ' + text + #13#10; //time_stamp is a function 
end; 

的問題是,我怎麼能訪問這些MSGBOX的過程裏面的方法呢? 。編輯的問題,如果它不夠清晰 注2:剛剛還試圖用TChatForm.MsgBox/ChatForm.MsgBox但仍unsuccessfull ..

回答

4

(程序不能因「未申報undentifier MSGBOX」

注意編譯再次

procedure add_text(MsgBox:TRichedit;const text : String); 
begin 
    MsgBox.SetFocus; 
    MsgBox.SelStart := MsgBox.GetTextLen; 
    MsgBox.Perform(EM_SCROLLCARET, 0, 0); 
    MsgBox.SelText := time_stamp + ' ' + text + #13#10; //time_stamp is a function 
end; 
+1

我現在羞愧 – Eduard

+0

Uoops,對不起,不想這樣...... – bummi

+0

沒事的,小的前進腳步感謝 – Eduard

相關問題