共 109 篇文章 |
|
(1)图片从文件导入。BitmapImage image = new BitmapImage();//已知Binary binary.MemoryStream ms = new MemoryStream(binary.//已知BitmapImage image.JpegBitmapEncoder encoder = new JpegBitmapEncoder();FileStream fileStream = new FileStream(imageFileName, FileMode.ImageBrush imageBrush = new ImageBrush(image); 阅2 转自xyjackxjw 公众公开 16-07-13 16:25 |
(2)利用Enum的静态方法GetName与GetNames: public static string GetName(Type enumType,Object value) public static string[] GetNames(Type enumType) 例如:Enum.GetName(typeof(Colors),3))与Enum.GetName(typeof(Colors), Colors.Blue))的值都是"Blue" Enum.GetNames(typeof(Colors))将返回枚举字符串数组。例如:Colors colo... 阅59 转0 评0 公众公开 15-09-29 11:02 |
阅2221 转9 评0 公众公开 15-08-11 14:11 |
阅3984 转72 评0 公众公开 15-08-08 14:38 |
DateTime格式存到SQL数据库的问题DateTime.Now.ToShortDateString()在不同的时间设置下结果不同,当系统设置的时间格式中带汉字‘上午’、‘下午’或时间中带‘星期X’时,SQL查询会出错。 阅241 转0 评0 公众公开 15-07-22 10:01 |
Winform判断窗体程序需要判断窗体是由代码关闭还是通过点击右上角上X号关闭。None 关闭原因未定义或未能确定WindowsShutDown操作系统正在关闭所有应用程序以便准备关机MdiFormClosing此多文档界面(UI)窗体的父窗体正在关闭userClosing 用户正在通过用户界面(UI)关闭该窗体,例如通过单击窗体“X”关闭按钮,通过调用this.Close(),或通过Alt... 阅1492 转6 评0 公众公开 15-06-09 14:51 |
指定Webbrowser控件内核版本的方案。注册表中注明当前本机装的IE版本HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer下面有名称为Version的项,其值为IE的版本.IE8 Standards Mode 8000 (0x1F40) -- IE8 标准模式 (Standard Mode), IE8默认的模式。IE7 Standards Mode 7000 (0x1B58) -- IE7 兼容视图模式 (Compatible View), ... 阅3394 转13 评0 公众公开 15-05-27 14:03 |
WPF界面添加WinForm的Webbrowser控件。2.页面代码: <Window x:Class="Demo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="378" ... 阅5 转自风中Robin 公众公开 15-03-01 14:58 |
WPF WebBrowser控件禁止弹出新窗口。WebBrowser控件禁止弹出新窗口强制链接在当前窗口打开。二、在WebBrowser控件的LoadCompleted事件方法中加入以下代码:HTMLDocumentClass doc = (HTMLDocumentClass)this.wb.foreach (IHTMLElement link in doc.links)foreach (IHTMLElement form in doc.forms)form.setAttribute("target", "... 阅2226 转20 评0 公众公开 15-02-28 18:09 |
axWindowsMediaPlayer控件循环播放方法方法一:axWindowsMediaPlayer1.settings.setMode("loop",true);方法二:在控件的PlayStateChanged事件里加代码:if ( axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsStopped ) { axWindowsMediaPlayer1.Ctlcontrols.play(); 阅1528 转0 评0 公众公开 14-11-18 11:50 |