winforms

Winforms Could not load file or assembly 'Microsoft.ReportDesigner, Version=10.0.0.0' in VS2012

假如想象 提交于 2021-02-18 20:15:10
问题 This is driving me nuts. I have a winforms app build in VS2012 targeting .NET 4.5. On a few forms I have to use a ReportViewer. At first I worked with ReportViewer for 2012 (version 11.0.0.0). All working fine. However, my client doesn't want to install this version on their workstations yet because this version uses the CLR Types SQL 2012. Don't ask me why, but I have to accept this for now. So I decided to use the previous reportviewer version 10.0.0.0. I downloaded the redistributional

Broken tab navigation in popup with WPF user control hosted inside Winforms in default AppDomain

主宰稳场 提交于 2021-02-18 19:54:22
问题 I have a WPF user control that uses a Popup. This control is a plugin and can be loaded in the main AppDomain or in a separate AppDomain, and it is hosted in a Winforms form using ElementHost. When the plugin is loaded in the main AppDomain, and the popup is opened, tabbing between the fields of the popup instead moves focus to the first control of the popup windows parent. When it is loaded in a new AppDomain, the tab behavior works as expected/desired (it cycles through the controls in the

Broken tab navigation in popup with WPF user control hosted inside Winforms in default AppDomain

巧了我就是萌 提交于 2021-02-18 19:53:13
问题 I have a WPF user control that uses a Popup. This control is a plugin and can be loaded in the main AppDomain or in a separate AppDomain, and it is hosted in a Winforms form using ElementHost. When the plugin is loaded in the main AppDomain, and the popup is opened, tabbing between the fields of the popup instead moves focus to the first control of the popup windows parent. When it is loaded in a new AppDomain, the tab behavior works as expected/desired (it cycles through the controls in the

Touch screen operations for .NET windows application?

自闭症网瘾萝莉.ら 提交于 2021-02-18 19:29:31
问题 We are building a Windows application in .NET and one of its requirements is touch screen monitor. Other than that, it's a normal windows form based application. But except for making UI items little bigger for touch, I can't find anything I as a developer need to do for the requirement since touch screen is basically mouse operations. Am I missing something? 回答1: No, you are not missing anything. Do get the actual hardware hooked up so you can test it, "little bigger" is invariably

How to update UI (text fields) during long running function?

佐手、 提交于 2021-02-18 17:38:07
问题 I know that the question may not make sense, and I'm having a tough time trying to think of a way to explain it, so I will show a snippet of code to help. I'm using Winforms on visual studio express 2010: private void button1(object sender, EventArgs e) { txtOutput.Text += "Auto-collecting variables. This may take several minutes"; string v = foo(); txtOutput.Text += "\n" + v; string b = bar(); txtOutput.Text += "\n" + b; txtOutput.SelectionStart = txtOutput.Text.Length; txtOutput

remove all EventHandlers of a specific Control

回眸只為那壹抹淺笑 提交于 2021-02-18 17:11:17
问题 I'm writing an application in winForm. I have a panel in from1 and it has many event handler. When I dispose panel1 and create new panel , the previous events exist & they fire. For removing panel1 events I have tryed code below. panel1.Click -= clickHandle_1 ; But it doesn't work every where in program code. for example in another method. How can I remove all previous events of panel1 when I create new panel1 ? 回答1: According to this, for cancelling all Click Events of panel1 do this:

c# How to show name and insert values (name's ID ) from combobox in c#

為{幸葍}努か 提交于 2021-02-18 14:50:46
问题 Thank you guys in advance. I'am new user in c# Windows Forms. I have a table with id's and name ID | Name --------------- 1 | Lion 2 | Tiger 3 | Crocodile If I want to display from a table to combobox I did like this. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace Insert_update_delete_nr2 { public partial class Form1 :

c# How to show name and insert values (name's ID ) from combobox in c#

六眼飞鱼酱① 提交于 2021-02-18 14:49:29
问题 Thank you guys in advance. I'am new user in c# Windows Forms. I have a table with id's and name ID | Name --------------- 1 | Lion 2 | Tiger 3 | Crocodile If I want to display from a table to combobox I did like this. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace Insert_update_delete_nr2 { public partial class Form1 :

Geolocation in WinForms application

我与影子孤独终老i 提交于 2021-02-18 12:58:12
问题 I want to create a WinForms app that can detect location just like a web browser would using the javascript function navigator.geolocation.getCurrentPosition(showPosition); Is there some way to do this in WinForms directly? I thought that I might be able to use the WebBrowser control to do this but I don't believe this supports Geolocation (unless someone knows otherwise?) Apparently the Gecko browser does support gelocation but this is not an option for me because client may have a different

How do I detect if a Windows device is touch-enabled

元气小坏坏 提交于 2021-02-18 12:13:44
问题 How do I detect if a device is touch-enabled in c# for a WinForms app (Not WPF). I found information on GetSystemMetrics...can't find how to use this in c#. I Tried using System.Windows.Input.Tablet class..not coming up in c#, even though I am using .Net Framework 4.5. I Tried using System.Windows.Devices...not coming up in c#, even though I am using .Net Framework 4.5. I have also checked This and This, which would seem to make this question a duplicate. However, neither of these answers my