摘要:一个简单的例子:http://www.codeproject.com/Tips/301836/Simple-SMTP-E-Mail-Sender-in-Csharp-Console-applic
阅读全文
随笔分类 - How To
questions & solutions
摘要:通常情况下命令能否执行的状态更新(如:按钮绑定一个命令,根据条件,按钮需要被启用或者灰掉)由框架自动完成。某些情况下,按钮不会自动更新,需要用鼠标点一下窗口,才更新。 可以强制更新:CommandManager.InvalidateRequerySuggested(); 参考:MSDN
阅读全文
摘要:chm文件本质上就是个压缩文件,使用7z压缩软件就可以open Archive, 看到所有的这些内容。 如果想用代码读取,要知道 topic 和 subtopic : this.webBrowser1.Navigate("mk:@MSITStore:E:\\xxx.chm::/xxx_aa.htm"); -
阅读全文
摘要:To instrument a binary using the command-line tools http://msdn.microsoft.com/en-us/library/aa985635.aspx 链接的文档中有个错误,第4步中,start:/trace 应该是 /start:trace 使用 IDE 时,总是出现 “The process cannot access the f...
阅读全文
摘要:最简单的方法是 System.Windows.Forms.NotifyIcon public partial class MainWindow { public MainWindow() { InitializeComponent(); // show in system tray this.ShowInTaskbar = false; NotifyIcon ni = new NotifyIcon...
阅读全文
摘要:在MFC窗口中嵌入WPF控件时 Transparency settings. A top-level window can be configured to blend with the other windows on the desktop according to the per-pixel transparency of the WPF content. To enable this, s...
阅读全文
摘要:如何设置每次滚动多少? 1,点击向上、向下按钮时,由 ScrollBar.SmallChange 决定; 2,点击 repeat button 时,由 ScrollBar.LargeChange 决定; 3,拖动 thrum 时,根据 thrum 的像素位置,转换到 [Minimum, Maximum] 区间;
阅读全文
摘要:直接 cast 即可 System::String^ s1 = gcnew System::String("How easy!");CString s = (CString)s1; 看 CStringT 的源代码,CStringT 中有一个传入 System String 的构造函数: // This template will compile only for // class SystemSt...
阅读全文
摘要:拖动Itemhttp://marlongrech.wordpress.com/2007/12/28/drag-drop-using-listboxes-part-1/http://marlongrech.wordpress.com/2007/12/29/drag-drop-using-listboxes-part-2/选择已经选中的Item选择一个已经选中的 item :有时,需要处理选择一个已经选中的 item,可是这时 SelectionChanged 不会被再次触发。一个解决方法是,用 EventSetter 将 item 的事件代理出去。<ListBox SelectionCha
阅读全文
摘要:处理在不同DPI情况下GUI显示的问题,有2个方法:用 ViewBox 包一层运行时转换转换像素单位使用 MarkupExtensionCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->namespace Program{ public class pxExtension : MarkupExtension { private readonly double _len; public pxExtension(string len) { try
阅读全文
摘要:1,使用 WPF 自定制:用 2 个 RepeatButton,用 ViewBox 包装“”“”作为 Content ,再旋转 90 度。2,包装 Windows.Forms.DomainUpDown 或者 Windows.Forms.NumericUpDown
阅读全文
摘要:例子1 :需要获得 ListBox 中的 Canvas方法1:Loaded 事件[代码]方法2:[代码]例子2:想获取一个可编辑的 ComboBox 中的 TextBox (顺便说一句,如果不可编辑,则是个 TextBlock,可以使用 SNOOP 来观察)可编辑的ComboBox含有一个TextBox使用VisualTreeHelper找到TextBox
阅读全文
摘要:1,资源浏览器中输入 %APPDATA%\Microsoft\Windows\SendTo ,回车,打开 Send To 文件夹;2,创建一个快捷方式,例如 NotePad
阅读全文
摘要:在MFC GUI程序弹出WPF窗口,可能有这样一个问题,WPF窗口在任务栏上有一个图标,某些操作(如打开文件对话框)后,WPF窗口被隐藏到了MFC主窗口后面,这时候用户体验就与CDialog有明显不同了。为保持一致,解决这个问题的方法:在MFC程序中加入WPF窗口,把MFC窗口设置为WPF窗口的父,并且不再taskbar中显示WPF窗口
阅读全文
摘要:new and create[代码]需要处理,non-client area destory 消息,OK 按钮,Cancel 按钮[代码]在 non-client area destroy 时,delete 上面 new 出来的对话框[代码]在 OK 和 Cancel 时,调用 DestroyWindow,它会发出 WM_NCDESTORY[代码]
阅读全文
摘要:一位朋友遇到的问题和解决方法:问题:我现在在为产品系列支持显示实时数据库的记录的长名,这个长名最长256个字符,在所有的产品的ListView中,当鼠标滑过一个ListItem时,都需要一个多行文本的的ToolTip来显示这个长名但是对于我们有些产品是很古老的VB程序,VB中的ListView如何显示多行文本的ToolTip?如果是MFC程序中的CListCtrl,我可以自从CToolTipCtr...
阅读全文

浙公网安备 33010602011771号