起步软件技术论坛-X3

 找回密码
 立即注册
搜索
楼主: chinavvv

【结帖】邮件附件源码

[复制链接]
 楼主| 发表于 2008-7-7 10:41:41 | 显示全部楼层
关键是上传之后能够很形象的显示,比如:

11.jpg

1.05 MB, 下载次数: 162

回复 支持 反对

使用道具 举报

发表于 2008-7-7 10:46:06 | 显示全部楼层
对阿。上面不都说了参考部分了么?
可以放一个listview来处理,具体还是请楼主参考下吧。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-7 10:50:04 | 显示全部楼层
关键是原来没做过邮件这部分,还希望能够给出较详细的指点。
回复 支持 反对

使用道具 举报

发表于 2008-7-7 10:52:50 | 显示全部楼层
请看业务模型\协同系统\个人事务\邮件库\邮件编辑窗体
procedure TMAILEDITFORM.RefreshAttachs;
var
  I: Integer;
  lListItem: TListItem;
  lIcon: TIcon;
begin
  Attachments.Clear;
  msgMail.GetAttachFileNames(Attachments);
  if Attachments.Count > 0 then
  begin
    lvwAttachments.Items.BeginUpdate;
    lIcon := TIcon.Create;
    try
      lvwAttachments.Items.Clear;
      imgAttachSmall.Clear;
      for I := 0 to Attachments.Count - 1 do
      begin
        lListItem := lvwAttachments.Items.Add;
        lListItem.Caption := Attachments[I];
        GetFileIcon(Attachments[I], lIcon);
        lListItem.ImageIndex := imgAttachLarge.AddIcon(lIcon);
        lListItem.Data := Attachments.Objects[I];
        imgAttachSmall.AddIcon(lIcon);
      end;
    finally
      lIcon.Free;
      lvwAttachments.Items.EndUpdate;
    end;
    lvwAttachments.Selected := lvwAttachments.Items[0];
  end
  else begin
    lvwAttachments.Items.Clear;
    imgAttachSmall.Clear;
  end;
  ShowAttachments;
end;
请楼主参考这段代码。这个代码就是邮件部分,添加附件后,在lvwAttachments里显示具体的附件信息的(11楼图所示的那种效果)。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-7 11:01:20 | 显示全部楼层
请问lvwAttachments是哪个控件?
回复 支持 反对

使用道具 举报

发表于 2008-7-7 11:04:33 | 显示全部楼层
listview
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-7 11:17:09 | 显示全部楼层
“邮件编辑窗体”是不是就是邮件窗体,我这里怎么找不到呀?

33.jpg

576.05 KB, 下载次数: 149

回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-7 11:20:06 | 显示全部楼层
Attachments.Clear;
Attachments是哪个控件清空?
回复 支持 反对

使用道具 举报

发表于 2008-7-7 11:41:53 | 显示全部楼层
楼主,什么版本?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-7 11:44:16 | 显示全部楼层
3.0.6.2826
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-18 23:12 , Processed in 0.039312 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表