我想把edit里面的内容写到messagebox函数里,应该怎样写?
解决方案 »
- 新手求助~关于列表框的
- 卧薪尝胆,攒够200分我放一次,顺便给这群LS一次BS的机会。
- DBgrid问题:点击dbgrid表的某一列表头,可以使该列变成指定颜色,如何实现?
- 关于在DELPHI中用ADO存取数据的问题?
- 一个VB版的API问题:用sendmessage向同form的命令按钮发回车键消息,为何无效?
- year=2003(integer) month=3(integer),如何能组合他们成为2003-03的日期型
- 如何執行sql語句?
- 高手哪里去了?
- 学Deiphi的困惑!!!
- 如何向注册表中写入一个二进制数???
- 关于delphi help的问题
- DBGrid多行处理,小菜请教大虾,在线等待~急急急~
var sTemp:string;
iType:integer;
begin
// MB_ICONWARNING =W
// MB_ICONQUESTION =Q
// MB_ICONERROR =E
// MB_ICONINFORMATION =I information if UpperCase(sType)='W' then iType:=0;
if UpperCase(sType)='Q' then iType:=1;
if UpperCase(sType)='E' then iType:=0;
if UpperCase(sType)='I' then iType:=0;
if iType=0 then
begin
if UpperCase(sType)='W' then
MessageBox(Handle,Pchar(sMsg),'警告信息',MB_ICONWARNING+MB_OK)
else
if UpperCase(sType)='E' then
MessageBox(Handle,Pchar(sMsg),'错误信息',MB_ICONERROR+MB_OK)
else
MessageBox(Handle,Pchar(sMsg),'提示信息',MB_ICONINFORMATION+MB_OK);
Result:=True;
end
else
begin
if MessageBox(Handle,Pchar(sMsg),'提示信息',
MB_ICONQUESTION+MB_YesNo) = Id_Yes then Result:=True
else
Result:=False;
end;
end;这是我写的一个关于提示信息的function 你可以试一下,如果好用的话那就用吧。
其中的'aaaa' 也可以是一个变量或是你的EDIT.TEXT 不就可以了吗?
你可以用类型转化把Edit1.text转化为pchar类型的!
有问题请发信息到我的E-mail:[email protected]
begin
showMessage(edit1.Text);
application.MessageBox(pchar(edit1.Text),'caption',mb_ok or mb_iconinformation);end;
我试过了!可以!!!
有问题请发信息到我的E-mail:[email protected]
begin
application.MessageBox(pchar(edit1.Text),'caption',mb_ok or mb_iconinformation);
end;//PChar()是关键