我有一個備忘錄字段,可以顯示如何使用我的GUI的說明。我爲備忘錄啓用了水平和垂直滾動條。兩個滾動條均顯示爲詳細說明,並且在垂直和水平方向都超過了框架。但是,垂直滾動條始終位於底部,所以除非用戶向上滾動,否則他將在開始時錯過指示。水平滾動條正確在左側。我需要在Object Inspector
中更改備忘錄的某些屬性以確保垂直欄位於頂部,以便用戶可以從頭閱讀說明?垂直滾動條總是在底部 - Delphi
我已將說明保存爲名爲Instructions的字符串。我這個字符串複製到該備忘錄由下面的代碼的方式:
procedure TfrmHSR.mmuDispInstructionsClick(Sender: TObject);
//display instructions in Memo field
var
DispText: string;
begin
Memo1.Clear;
DispText := Wraptext(Instructions, 125);
Memo1.Lines.Add(DispText);
mmuDisplayClear.Enabled := True;
mmuFileSave.Enabled := False;
//if input file created and opened, allow display of input data
if Assigned(InputFile) then //if TStringList has been created
begin
if (InputFile.Count > 0) then mmuDispData.Enabled := True
else mmuDispData.Enabled := False;
end
else mmuDispData.Enabled := False;
//if results available, allow display
if Assigned(OutputFile) then //if TStringList has been created
begin
if (OutputFile.Count > 0) then mmuDispResults.Enabled := True
else mmuDispResults.Enabled := False;
end
else mmuDispResults.Enabled := False;
mmuDispInstructions.Enabled := False;
end;
你是如何填補備忘錄?我無法在快速測試應用程序中複製此內容。 –
如果你要將插入符號保留在左上角,那麼我不認爲有明確的設置可以這樣做。但是,您可以調用此'Memo.Perform(EM_SETSEL,0,0); Memo.Perform(EM_SCROLLCARET,0,0);'添加行後。 – TLama
當用戶點擊「顯示」菜單中的「顯示指令」子菜單選項(可以顯示其他內容)時,我將這些指令保存爲長字符串(帶有大量換行符)也在菜單字段中,例如上傳的數據)。 – Serge