我需要一种方法来确定我的应用程序的mainform是否是fsMDIForm.
如何才能做到这一点?
我需要使用Thunderbird和Delphi XE3发送带附件的电子邮件.我不知道从哪里开始所以我问是否有人链接到我可能找到信息的网站.
我有一个我在FormCreate上创建的TStringList
ScriptList := TStringList.Create;
Run Code Online (Sandbox Code Playgroud)
在将字符串加载到列表中后,在我的程序中的另一个函数中,我有以下代码
ScriptList.Sorted := True;
ScriptList.Sort;
for i := 0 to ScriptList.Count - 1 do
ShowMessage(ScriptList[i]);
Run Code Online (Sandbox Code Playgroud)
但列表没有排序为什么会这样?
已编辑:填写列表由以下代码完成
function TfrmMain.ScriptsLocate(const aComputer: boolean = False): integer;
var
ScriptPath: string;
TempList: TStringList;
begin
TempList := TStringList.Create;
try
if aComputer = True then
begin
ScriptPath := Folders.DirScripts;
Files.Search(TempList, ScriptPath, '*.logon', False);
ScriptList.AddStrings(TempList);
end
else
begin
if ServerCheck then
begin
ScriptPath := ServerPath + 'scripts_' + Network.ComputerName + '\';
Folders.Validate(ScriptPath);
TempList.Clear;
Files.Search(TempList, ScriptPath, '*.logon', False);
ScriptList.AddStrings(TempList);
Application.ProcessMessages;
ScriptPath := ServerPath + …Run Code Online (Sandbox Code Playgroud) 我有一个需要一些时间来创建的表单,我想向用户显示正在发生的事情,当我调用显示表单的函数时,我已经制作了一个沙漏光标.但我的问题是我无法得到
Screen.Cursor := crDefault;
Run Code Online (Sandbox Code Playgroud)
在窗体实际显示在屏幕上时首先执行.我尝试了所有尝试有点意义但没有运气的事件.在表单可见之前,沙漏消失了.
我可以尝试下一步来实现这一目标.
我需要更多信息请说明,我会找到它.
我在调用创建表单的函数之前在我的mainform中设置了沙漏,然后我的表单显示如下.
procedure TfrmJsCv.FormShow(Sender: TObject);
begin
fReportFile := Folders.DirDatabase + 'jobsearch_print.mdb';
btnPrint.Visible := FileExists(fReportFile);
try
SetupMain;
SetupCertificates;
SetupContacts;
SetupCourse;
SetupJobs;
SetupLanguage;
SetupLanguageLevels;
SetupItKnowledge;
SetupKnowledgeLevels;
SetupKnowledgeTypes;
SetupOther;
SetupReferences;
SetupSchool;
SetupYears;
except
on E: exception do
Logfile.Error('F_JsCv.FormShow: ' + E.Message);
end;
PagCurriculumVitae.ActivePageIndex := 0;
end;
Run Code Online (Sandbox Code Playgroud)
我试图把Screen.Cursor:= crDefault; 在OnActivate,OnCreate,OnShow,OnResize,OnPaint事件上,但在窗体准备好/在屏幕上可见之前重置沙漏
所有Setupxxxxx过程都是为相当复杂的表单准备数据的过程 - 它从12个不同的表中收集数据.
我有以下函数用于检查我的代码是否从IDE运行.真正令人沮丧的是,即使代码是从IDE运行的,函数也会不时返回False.事实上,当它工作正常时,我找不到任何共同点,什么时候没有.任何人都知道如何修复此功能或其他方法进行此检查.(我使用该函数在开发过程中创建一个包含测试功能的菜单,并将其隐藏到最终用户)
function IDERunning: Bool;
begin
Result := (FindWindow('TAppBuilder', nil) > 0) and
(FindWindow('TPropertyInspector', 'Object Inspector') > 0);
end;
Run Code Online (Sandbox Code Playgroud)
我使用的是Delphi XE8
我有以下带参数的功能
aFile =完整的文件名
aFolder =要复制/移动到的foldername
aGuid =文档分配的指导
aAction =如何处理fil(移动或复制)
如果Trim(NewFile)= Trim(aFile),我会猜测该行,然后如果旧文件与新文件相同,则应该停止代码执行任何操作.但事实并非如此.即使文件相同,如果执行FileExists(NewFile),该行.
在我的调试日志中
30-05-2013 08:10:34:840#新文件:C:_Delphi_Compiled\HomeSuite\Debug\indbo\computerfladskaerm\968ED02C-21B5-4582-8A49-8463E01ADCB3.pdf
30-05-2013 08:10:34:841#旧文件:C:_Delphi_Compiled\HomeSuite\Debug\Indbo\computerfladskaerm\968ED02C-21B5-4582-8A49-8463E01ADCB3.pdf
据我所知,这些名字是一样的
function DocumentHandle(aFile, aFolder, aGuid: string; aAction: TDocumentAction): string;
const
CopyMsg = 'Der findes allerede en fil med det navn!' + sLineBreak +
'Filen omdøbes derfor til et unikt navn';
var
NewFile: string;
begin
Result := aFile;
try
NewFile := ExtractFileName(aFile);
NewFile := aFolder + NewFile;
if Trim(NewFile) = Trim(aFile) then
Exit;
if FileExists(NewFile) then
begin
NewFile := ExtractFileExt(aFile);
NewFile := aFolder + CleanGuid(aGuid) …Run Code Online (Sandbox Code Playgroud) 我对JSON完全不了解,但我希望能够从URL http://stokercloud.dk/dev/getdriftjson.php?mac=oz8hp中读取一些数据,并能够将它们存储在数据库中.但我不知道从哪里开始,所以我想我会在这里询问一些提示,也许还有一些我可能从中学到的样本的链接我知道输出可能看起来很混乱,但我列出了每个项目的内容.
我有以下代码
procedure TfrmJsApplications.colMaintStylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
var
aColumn: TcxCustomGridTableItem;
aValue: Variant;
begin
inherited;
try
aColumn := Sender.FindItemByName('colApplication_Doc');
aValue := aRecord.Values[aColumn.Index];
if VarToStr(aValue) <> '' then
colMaint.Properties.Buttons[0].Caption := 'Redigere'
else
colMaint.Properties.Buttons[0].Caption := 'Opret'
except
on E:exception do
Logfile.Error('F_JsApplications.colMaintStylesGetContentStyle: ' + E.Message);
end;
Run Code Online (Sandbox Code Playgroud)
在cxGrid中的列上运行.但由于某种原因,我根本无法弄清楚这一行
if VarToStr(aValue) <> '' then
Run Code Online (Sandbox Code Playgroud)
使功能崩溃.我知道当aValue成为Null值时,但据我所知,在这种情况下VarToStr应返回''
delphi ×8
forms ×2
devexpress ×1
email ×1
events ×1
ide ×1
json ×1
mdi ×1
parsing ×1
sorting ×1
tcxgrid ×1
thunderbird ×1
tstringlist ×1
variant ×1