摘要:
MainWindow中: 1 <Window.Resources> 2 <Style TargetType="TabItem"> 3 <Setter Property="Header" Value="{Binding DataContext.Title}" /> 4 </Style> 5 </Win 阅读全文
摘要:
在MVVM模式下,在通常使用命令(Command)绑定的方式的时候 ,使用的是 CommandParameter 属性进行参数的传递。 但是很多时候,有一些事件我们需要使用其中的一些事件里面的参数,以获取相关数据或状态,但是使用命令绑定的方式又没办法达到这个要求,那么如何做呢? 1、引用相关命名空间 阅读全文
摘要:
在最近的工作中遇到很多,类似这种layUI风格的Combox: 因为WPF原本的控件,并不具备这种功能,尝试重写Combox的模板,发现无从下手。 于是尝试从多个控件组合来实现这个功能。 这里使用了Popup 来存放数据,发现还不错。 将popup分为三列,每个列的列宽设置位自动,当点击其中一个选项 阅读全文
摘要:
<Window.Resources> <!-- TabItem的样式 --> <Style TargetType="{x:Type TabItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType=" 阅读全文
摘要:
最近工作需要,需要重绘RaidButton控件,具体想要达成的的效果是这样的: 当点击按钮任意一个地方的时候,按钮的背景改变。 于是我是这样对控件模板进行修改的: <Style x:Key="raidstyle" TargetType="RadioButton"> <Setter Property= 阅读全文
摘要:
方法一:(调用Excel的COM组件) 在项目中打开Add Reference对话框,选择COM栏,之后在COM列表中找到"Microsoft Excel 11.0 Object Library"(Office 2003),然后将其加入到项目的References中即可。Visual C#.NET会 阅读全文
摘要:
private void ListFiles(string path) { string dj = string.Format("{0}\\{1}\\", path, "物品照"); try { FileSystemInfo djinfo = new Dir... 阅读全文
摘要:
string url = ""; string usernamePassword = username + ":" + password; HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(url); myReq.Credentials = new NetworkCredential(username, password); //... 阅读全文
摘要:
string username="username"; string password="password"; //注意这里的格式哦,为 "username:password" string usernamePassword = username + ":" + password; CredentialCache mycache = new CredentialCache(); mycache.A 阅读全文