摘要: 图1中标注出来的是VS2013中的QT界面设计师文件,双击默认打开的是Qt设计师工具。在界面上面拉入一个PushButton,点击编辑信号与槽按钮进入编辑模式。选择信号clicked(),发现可以从QWidget继承很多槽函数,暂时先选择close()槽函数,点OK保存后,VS2013中有个文件“u... 阅读全文
posted @ 2014-07-04 21:02 北美上映 阅读(10388) 评论(1) 推荐(0) 编辑
摘要: 网上很多关于QT中文乱码的问题及答案,但情况不同解决方法也不一样。本方案适用于VS2013+QT5.3环境(编译器是VC)using namespace std;# pragma execution_character_set("utf-8")//文件的开头要声明字符编码UTF-8,这样输出中文字符... 阅读全文
posted @ 2014-05-07 16:23 北美上映 阅读(9868) 评论(0) 推荐(1) 编辑
摘要: 初学QT,前期因为信号与槽只能在QT界面上面方便的使用,没有想到只要继承QObject便能使用且支持多线程操作。为了能够让后台自定义类能够使用信号与槽,首先在自定义类继承QObject1.DayouTraderSpi.h#include "qobject.h"class DayouTraderSpi... 阅读全文
posted @ 2014-05-06 14:25 北美上映 阅读(19506) 评论(1) 推荐(1) 编辑
摘要: //申明一个委托 private delegate void MyInvokeDelegate();//创建监听线程 ListenThread = new Thread(new ThreadStart(ListenFunction)); //启动线程 ListenThread.Start();win是一个Form窗口的句柄/// /// 监听方法,在线程中启动 /// void ListenFunct... 阅读全文
posted @ 2013-10-11 11:24 北美上映 阅读(729) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms; namespace CommonModel{ public class BalloonForm : Form { private System.ComponentModel.IContainer components = null; /// ... 阅读全文
posted @ 2013-10-09 10:41 北美上映 阅读(3336) 评论(0) 推荐(0) 编辑
摘要: public class ChangeImage { /// /// 将Image转换为byte[] /// /// Image /// byte[] public static byte[] ConvertImage(Image image) { MemoryStream ms = new MemoryStream(); image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); ... 阅读全文
posted @ 2013-09-26 11:23 北美上映 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 编写程序的时候,经常需要用的项目根目录。自己总结如下 1、取得控制台应用程序的根目录方法 方法1、Environment.CurrentDirectory 取得或设置当前工作目录的完整限定路径 方法2、AppDomain.CurrentDomain.BaseDirectory 获取基目录,它由程序集冲突解决程序用来探测程序集 2、取得Web应用程序的根目录方法 方法1、HttpRuntime.AppDomainAppPath.ToString();//获取承载在当前应用程序域中的应用程序的应用程序目录的物理驱动器路径。用于App_Data中获取 方法2、Server.MapPath(" 阅读全文
posted @ 2013-09-24 17:39 北美上映 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 这是个封装好的类,非常好用using System;using System.Runtime.InteropServices;namespace SystemHotKey{ public delegate void HotkeyEventHandler(int HotKeyID); public class Hotkey : System.Windows.Forms.IMessageFilter { System.Collections.Hashtable keyIDs = new System.Collections.Hashtable(); I... 阅读全文
posted @ 2013-09-24 15:09 北美上映 阅读(3278) 评论(0) 推荐(0) 编辑
摘要: click event.target表示发生点击事件的元素; this表示的是注册点击事件的元素。 阅读全文
posted @ 2013-07-25 11:13 北美上映 阅读(2700) 评论(0) 推荐(0) 编辑
摘要: I try to validate the FileName using regular expression but it is very slow and browser hanging.If I type the text in the input fast or entiring more than 40 chars then browser hanging. I need to kill itHere is my model and view. public class MyTester { [DisplayName("Zip File Name")] ... 阅读全文
posted @ 2013-01-07 15:06 北美上映 阅读(388) 评论(0) 推荐(0) 编辑