一.VS2013中,菜单-工具-选择工具箱项-COM组件-勾选“Adobe PDF Reader”-确定 二.在工具箱中就可以看到Adobe PDF Reader控件了,拖到窗体上. 拖到窗体上之后,就会自动引用2个dll:AcroPDFLib和AcroPDFLib,在编译的时候,VS会把Adobe PDF Reader ActiveX组件转换为2个.net组件:AxInterop.AcroPDFLib.dll和Interop.AcroPDFLib.dll 三.在我的项目中,才用代码创
方法有很多种,这里介绍项目中使用的两种 一.通过委托+事件的方法进行传值 (点击Form2中的button1按钮,将会把Form2中的textbox.text 传给Form1中的 lable.text) 先上效果图 以下是代码 public partial class Form2 : Form { public Form2() { InitializeComponent(); } public delegate void SendDataInvoke(string value); public
我写这个工具,主要是多次在将自己的代码和别人代码做对比时,不想繁琐地用眼看他设置的和自己设置的哪里不一样. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Properties { class Properties { /// <summary> /// 通过类型和对象获取对象键-值的字典集合. /// </summary> /// <
注解:最近做了一个小工具,在Winform中对Picture控件有一个需求,可以通过鼠标从外部拖拽图片到控件的上,释放鼠标,显示图片! 首先你需要对你的整个Fom窗口的AllowDrop设置Ture //函数从动态链接库中倒入(模拟鼠标事件) [System.Runtime.InteropServices.DllImport("user32")] private static extern int mouse_event(int dwFlags, int dx, int dy, int
winform的ComboBox中只能赋值text,显示和值是一样的,很多时候不能满足根本需要,熟悉B/S开发的coder最常用的就是text和value分开的,而且web下DropDownList本来就是分为text和value.ComboBox要实现同样功能,使item有多个值,只能用重写一个类来实现了. 重写类如下: using System; namespace sm { class cListItem { private string id = string.Empty; public