无论如何,RichRextBox只要文本框得到焦点,就会阻止只读的光标(IBeam)闪烁吗?
我试图阻止WM_SETFOCUS来自该消息,WndProc但它导致表单挂起.
if( m.Msg == 0x0007 ) return;
Run Code Online (Sandbox Code Playgroud) 每次在保存后更改设计器中的值时,都会删除.designer.cs文件.
有谁能告诉我如何解决这个问题?
有很多文章描述了如何在WPF中创建自定义形状的窗口但是没有一个(至少我找不到)描述了如何构建可重用的窗口,例如在其他窗口中继承它.
我试图从我的自定义窗口创建一个ControlTemplate.问题出在Close按钮和MoveDrag()方法上.
如果我将事件连接到ControlTemplate中的其他控件之一,则其Parent属性为null,因此我无法拖动或关闭窗口.
有没有人有任何想法如何创建可重用的自定义窗口模板或什么?
我正在尝试直接打印RDLC文件而不显示Microsoft Report Viewer,我已经按照MSDN的示例进行了操作但是现在,每次我调用LocalReport类实例的"Render"方法时,它都会抛出"所需的一个或多个参数"运行报告尚未指定." 例外.
谁能告诉我哪些参数是我错过的?或者如何找到有关此例外的更多详细信息?
LocalReport report = new LocalReport();
report.ReportPath = System.Windows.Forms.Application.StartupPath + "\\" + rdlcFileName;
report.EnableExternalImages = true;
ReportParameter[] reportParams = new ReportParameter[]
{
new ReportParameter("LogoAddress", settings.LogoFileName),
new ReportParameter("FooterValue", settings.InvoicesFooter)
};
report.SetParameters(reportParams);
report.DataSources.Add(new ReportDataSource("Invoice", new PrintableInvoice[] { invoice }));
report.DataSources.Add(new ReportDataSource("InvoiceItem", invoiceItems));
Warning[] warnings;
try
{
string deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>EMF</OutputFormat>" +
" <PageWidth>8.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.25in</MarginTop>" +
" <MarginLeft>0.25in</MarginLeft>" +
" <MarginRight>0.25in</MarginRight>" +
" <MarginBottom>0.25in</MarginBottom>" +
"</DeviceInfo>";
m_streams = new …Run Code Online (Sandbox Code Playgroud) 我有一个WCF服务,该服务已托管在Windows服务上,并使用BasicHttp端点为已连接到它的Windows Mobile设备提供服务.
问题是使用设备模拟器.我可以连接到服务并使用它没有任何问题,但使用实际的设备.我收到错误:
WCF请求失败,HTTP状态为405:方法不允许.
我使用以下代码来实现该服务.
BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
basicHttpBinding.UseDefaultWebProxy = false;
m_ServiceHost.AddServiceEndpoint(typeof(IKooft), basicHttpBinding, "KooftService");
m_ServiceHost.Open();
Run Code Online (Sandbox Code Playgroud)
我怎么解决这个问题?
我正在尝试使用Visual Studio 2008安装和部署项目安装我的Windows服务应用程序.我创建了一个"运行即服务"权限的用户帐户,并将ServiceProcessInstaller.Account设置为System.ServiceProcess.ServiceAccount.User,并将用户名和密码设置为我之前创建的用户.
spInstaller.Account = System.ServiceProcess.ServiceAccount.User;
spInstaller.Username = "USER NAME";
spInstaller.Password = "PASSWORD";
sInstaller.ServiceName = "SERVICE NAME";
sInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
Run Code Online (Sandbox Code Playgroud)
但在安装过程中,我收到以下错误:
错误:1001.帐户名无效或不存在,或者密码对于指定的帐户名无效
任何想法为什么我得到这个错误以及我如何解决它?谢谢.
我正在尝试为使用basicHttpBinding的Windows移动应用程序生成WCF代理客户端代码,并且我不断收到以下错误:
错误:工具中发生错误.
错误:应用程序中出错
之前我能够生成代理,但我不知道为什么突然发生这种情况.我已经阅读了Sameh Samir的帖子,但我使用的服务不使用我创建的任何消息合同(我使用过LINQ to SQL ORD),WCFTestClient可以连接到服务并显示合同.
UPDATE
似乎问题出在Windows 7 RC1上.我在Win7上尝试它并在XP上运行NetCFSvcUtil之后一切正常.
任何人都知道如何向Microsoft报告此问题?
我正在使用Linq to SQL并尝试使用DataOptions和AssociateWith过滤数据.我有一个名为Products的表,它有一个名为Id的主键和一个名为IsDeleted的标志,带有sql-datatype位.
当我使用下面的代码时,我得到" AssociateWith方法"的"实体.Product"类型的'IsDeleted'不支持子查询.
var context = new DataContext();
DataLoadOptions options = new DataLoadOptions();
options.AssociateWith<Product>(p => !p.IsDeleted);
context.LoadOptions = options;
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我试图在一个简单的类库中使用[Serializable]属性标记一个自定义异常类,该类目标是dnx451和dnxcore50,但遗憾的是我无法找到SerializableAttribute存在于哪个依赖项中.
您能否告诉我如何找到dnxcore50依赖项?
当我为我的ASP.Net Core 1.1应用程序启用BrowserLink时,我在浏览器中收到以下错误,我认为因为BrowserLink不起作用.
Browser Link: Exception thrown when trying to invoke Browser Link extension callback "microsoft.visualstudio.web.browserlink.sourcemappingextensionfactory.getCssMappingData":
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Web.Extensions.Common.Helpers.VsWebUrlUtil.EnsureAbsoluteUrl(IVsHierarchy hierarchy, Uri& path)
at Microsoft.VisualStudio.Web.Extensions.Common.Helpers.VsWebUrlUtil.GetSimpleVsWebUrlFromUrl(IVsHierarchy hierarchy, Uri url, ILocationContainer& container)
at Microsoft.VisualStudio.Web.Extensions.Common.Helpers.VsWebUrlUtil.GetVsWebUrlFromUrl(IVsHierarchy hierarchy, Uri url)
at Microsoft.VisualStudio.Web.Extensions.Common.Helpers.LazyLocationContainer.LazyLocationContainerFromUrl.CreateActualLocationContainer()
at Microsoft.VisualStudio.Web.Extensions.Common.Helpers.LazyLocationContainer.GetPhysicalPath(Uri& physicalPath)
at Microsoft.VisualStudio.Web.Extensions.Common.Helpers.DocumentLocation.Microsoft.VisualStudio.Web.Extensions.Common.Helpers.IDocumentLocation.GetPhysicalPath(Uri& physicalPath)
at Microsoft.VisualStudio.Web.BrowserLink.SourceMappingExtension.getCssMappingData(String cssUrl, String[] selectors)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, …Run Code Online (Sandbox Code Playgroud) browser-link asp.net-core-mvc asp.net-core visual-studio-2017
asp.net-core ×2
wcf ×2
asp.net ×1
browser-link ×1
dnx ×1
exception ×1
linq ×1
linq-to-sql ×1
printing ×1
rdlc ×1
reportviewer ×1
richtextbox ×1
sql ×1
window ×1
winforms ×1
wpf ×1