上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 49 下一页
摘要: 当ListView多选时返回第一次选中的项索引正确定义一个变量=-1 表示第一次没选任何一项privateintFirstSelectedIndex=-1;更新FirstSelectedIndex的值一定要放在Mouse_Click放在 listView1_SelectedIndexChanged或listView1_ItemSelectionChanged无效privatevoidlistView1_MouseClick(objectsender,MouseEventArgse){intcount=listView1.SelectedItems.Count;if(count>0){in 阅读全文
posted @ 2013-11-25 13:32 XE2011 阅读(351) 评论(0) 推荐(0)
摘要: 处理了以下问题 System.IO.Directory.Delete 目录不是空的。 对路径“License.rtf”的访问被拒绝 这个文件为只读属性 当这个文件夹的子文件夹处于打开时删除失败 阅读全文
posted @ 2013-11-24 23:33 XE2011 阅读(313) 评论(0) 推荐(0)
摘要: 附件1:http://files.cnblogs.com/xe2011/CSharp_WindowsForms_delegate03.rar一个RTF文件管理器描述 Form2,Form3,Form4都是独立存在的,同时完成独立的功能,相互不依赖。最后把Form2,Form3,Form4集合放在FORM1上,实际上需要这3个的窗体Form2,Form3,Form4间相互得到改变后的变量值。FORM2 文件夹列表 在FORM1中设置一初始文件夹路径 要实现的功能:当单击本窗体中的TreeView.node时,要求Form3.ListView的文件列表同时更新。FORM3 文件列表 需要... 阅读全文
posted @ 2013-11-24 19:08 XE2011 阅读(467) 评论(0) 推荐(0)
摘要: 附件:http://files.cnblogs.com/xe2011/CSharp_WindowsForms_delegate02.rar窗体2 和窗体3 都是动态创建出来的现在 FORM3.TEXT要即时 = FORM2.TEXTFORM1窗体代码 Form2 f2 = new Form2(); Form3 f3 = new Form3(); private void Form1_Load(object sender, EventArgs e) { f2.XYZ += new Form2.CallBack(GetF... 阅读全文
posted @ 2013-11-24 17:51 XE2011 阅读(321) 评论(0) 推荐(0)
摘要: 附件 http://files.cnblogs.com/xe2011/CSharp_WindowsForms_delegate01.rar需要每个窗体是独立存在,禁止相与引用窗体这样干净并且可以反复重用Form1的代码 private void button1_Click(object sender, EventArgs e) { Form2 f2 = new Form2(); f2.XYZ += new Form2.CallBack(GetForm2TextBox1Text); f2.Show(); ... 阅读全文
posted @ 2013-11-24 17:29 XE2011 阅读(459) 评论(0) 推荐(0)
摘要: 附件:http://files.cnblogs.com/xe2011/XML_Writer_And_Read.rar 下面这段代码实现了以下功能 数据保存 textBox1的文本,textBox2的文本,窗体的LEFT TOP WIDTH HEIGHT 读取数据 textBox1的文本,textBo 阅读全文
posted @ 2013-11-23 23:24 XE2011 阅读(401) 评论(0) 推荐(0)
摘要: using System.Runtime.InteropServices; private const int WS_HSCROLL = 0x100000;private const int WS_VSCROLL = 0x200000;private const int GWL_STYLE = (-16); [DllImport("user32.dll")] priv... 阅读全文
posted @ 2013-11-23 18:54 XE2011 阅读(689) 评论(0) 推荐(0)
摘要: 这个和WINDOWS创建RTF文件一样public void CreateRtfFile(string RtfFileName) { RichTextBox richTextBox1 = new RichTextBox(); richTextBox1.SaveFile(RtfFileName); }private void button1_Click(object sender, EventArgs e) { string Dir = @"C:\Users\Admin\Desktop\"; st... 阅读全文
posted @ 2013-11-23 17:25 XE2011 阅读(1548) 评论(0) 推荐(0)
摘要: saveFileDialog1.ShowDialog saveFileDialog.FileName 设置的时候是一个字符串。 如: 新建 RTF 文档.rtf 获得的时候 则为一个完整的路径。 如:C:\Users\Admin\Desktop\新建 RTF 文档.rtf saveFileDialo 阅读全文
posted @ 2013-11-23 15:32 XE2011 阅读(290) 评论(0) 推荐(0)
摘要: 一般处理可以使用 Replace("\r\n", ""); 来替换 如果文件路径带换行符的会错误(路径中有非法字符或者系统找不到文件) 替换\r 替换 \n 阅读全文
posted @ 2013-11-23 11:43 XE2011 阅读(225) 评论(0) 推荐(0)
摘要: 在运行中,输入 Explorer /select,C:\Windows\System32\cmd.exe 达到打开文件夹并选择文件夹内的一个文件的目的 http://hi.baidu.com/liyi93/item/2508abfc821a654f922af242打开文件所在位置并且选中这个文件 publicvoidExplorerFile(stringpath){System.Diagnostics.Process.Start("explorer.exe",@"/select,"+path);}打开文件夹 publicvoidExplorerDirec 阅读全文
posted @ 2013-11-21 23:59 XE2011 阅读(324) 评论(0) 推荐(0)
摘要: 附件:http://files.cnblogs.com/xe2011/TreeView_Drag_Directory%E6%93%8D%E4%BD%9C.rarTREEVIEW拖拽对应修改目录usingSystem.IO; privatestaticstringRootPath=@"D:\Administrator\Documents\TestData";//返回D:\Administrator\DocumentsprivatestringmyPath=GetDirectoryParentPath(RootPath);privatevoidForm1_Load(object 阅读全文
posted @ 2013-11-21 15:29 XE2011 阅读(298) 评论(0) 推荐(0)
摘要: 原目录 D:\ProgramFiles\Tencent 想要的目录 D:\ProgramFilesusingSystem.IO; //目录D:\Administrator\Documents\TestData//返回D:\Administrator\DocumentsprivatestringGetDirectoryParentPath(stringpath){DirectoryInfod=newDirectoryInfo(path);returnd.Parent.FullName;}privatevoidbutton1_Click(objectsender,EventAr... 阅读全文
posted @ 2013-11-20 21:46 XE2011 阅读(406) 评论(0) 推荐(0)
摘要: uses Vcl.Imaging.GIFImg;procedure TForm1.Button2Click(Sender: TObject);begin Image1.Picture.LoadFromFile('1.gif'); Image1.Transparent:=True; TGIFImage(Image1.Picture.Graphic).AnimationSpeed :... 阅读全文
posted @ 2013-11-20 17:27 XE2011 阅读(369) 评论(0) 推荐(0)
摘要: uses ADODB_TLB, CDO_TLB, ComObj,MSHTML;{$R *.dfm}{能把网页如 WWW.QQ.COM保存为一个单文件 .MHT但不能把一个 A.HTM保存为一个单文件 .MHT}procedure WB_SaveAs_MHT(WB: TWebBrowser; FileName: TFileName);var Msg: IMessage; Conf: IConfigu... 阅读全文
posted @ 2013-11-20 16:53 XE2011 阅读(322) 评论(0) 推荐(0)
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 49 下一页