winforms

Custom TreeNode bounds

狂风中的少年 提交于 2021-02-08 04:37:25
问题 How to extend the standard mouse behavior of a TreeView node (like selecting, hot tracking, expansion on double click etc.) over a wider node area? I've got a custom-drawn node that has a wider label than it would have if it was system-drawn and it only reacts to mouse actions when the cursor is within the ordinary node bounds. Any Ideas? BTW, intercepting TVM_GETITEMRECT and TVM_HITTEST won't do the trick. A few words about what I'm doing: I'm developing a WinForms tree control that normally

Adding elements to a form from another runspace

僤鯓⒐⒋嵵緔 提交于 2021-02-08 04:08:09
问题 I have a form in which as soon as ready several elements will be added (for example, a list). It may take some time to add them (from fractions of a second to several minutes). Therefore, I want to add processing to a separate thread (child). The number of elements is not known in advance (for example, how many files are in the folder), so they are created in the child stream. When the processing in the child stream ends, I want to display these elements on the main form (before that the form

How to run a Windows.Forms C# program from Terminal in OSX?

与世无争的帅哥 提交于 2021-02-08 04:00:43
问题 I have to use System.Windows.Forms for my C# course in school but I own a Macbook and Visual Studio says that it doesn't exist. I read that I could use WinForms if I installed Mono and then compile and run it from terminal using mcs hello.cs -pkg:dotnet . "hello.cs" is just a Hello World program using System.Windows.Forms... it compiles but when I do mono hello.exe it says: WARNING: The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at

Distinguishing between Click and DoubleClick events in C#

被刻印的时光 ゝ 提交于 2021-02-08 03:38:26
问题 I currently have a NotifyIcon as part of a Windows Form application. I would like to have the form show/hide on a double click of the icon and show a balloon tip when single clicked. I have the two functionalities working separately, but I can't find a way to have the app distinguish between a single click and double click. Right now, it treats a double click as two clicks. Is there a way to block the single click event if there is a second click detected? 回答1: There are 2 different kinds of

How to make button background transparent?

本秂侑毒 提交于 2021-02-08 03:11:17
问题 I have created one button and applied image (.png with transparent background) on it. My button background is set on transparent but as you can see the background color is still there. How can I make this work as it should? 回答1: Give this a shot. 'Making Existing Button Transparent btnKasa.FlatStyle = Windows.Forms.FlatStyle.Flat btnKasa.FlatAppearance.BorderSize = 0 btnKasa.FlatAppearance.MouseDownBackColor = Color.Transparent btnKasa.FlatAppearance.MouseOverBackColor = Color.Transparent

How to make button background transparent?

偶尔善良 提交于 2021-02-08 03:07:29
问题 I have created one button and applied image (.png with transparent background) on it. My button background is set on transparent but as you can see the background color is still there. How can I make this work as it should? 回答1: Give this a shot. 'Making Existing Button Transparent btnKasa.FlatStyle = Windows.Forms.FlatStyle.Flat btnKasa.FlatAppearance.BorderSize = 0 btnKasa.FlatAppearance.MouseDownBackColor = Color.Transparent btnKasa.FlatAppearance.MouseOverBackColor = Color.Transparent

Access a form's control by name

时光毁灭记忆、已成空白 提交于 2021-02-07 22:46:19
问题 not sure whether the title of this post is accurate. I'm trying to access windows form controls and their properties by "composing" their name within a loop, but I can't seem to find the related documentation. Using VB.net. Basically, say I have the following: Dim myDt As New DataTable Dim row As DataRow = myDt.NewRow() row.Item("col01") = Me.label01.Text row.Item("col02") = Me.label02.Text '... row.Item("colN") = Me.labelN.Text I'd like to write a for loop instead of N separate instructions.

DataGridView Not Updating in C# When Binding Source is Correct

流过昼夜 提交于 2021-02-07 20:25:55
问题 I have a DataGridView and an Edit button. When I click the Edit button and change a field, I press Save and the DataGridView comes up again. The problem is that my changes aren't showing. Using the debugger, I have looked in the DGV and in the BindingSource and the correct data is there. It is just not displaying in the DGV. Here is my code - I do realize that it is semi-redundant but, at this point, I'm four hours into it and am willing to try anything. this.iSOXTableAdapter.FillByISOX(this

Different versions of Crystal Reports runtime

醉酒当歌 提交于 2021-02-07 20:01:42
问题 I have two WinForm applications that use CR runtime to generate reprts.When CR runtime 13.20 is installed, the newer application will complain that it can't find and load CR 13.21 (13.0.350) assembly. If I upgrade CR runtime to 13.21 (13.0.350) that new application will work but the older one errors out with exception stating that it can't find and load CR runtime assembly 13.20 (13.0.200). All workstations operate on CR runtime 13.20 so how can I make new app created in VS2015 with CR 13.21

Different versions of Crystal Reports runtime

家住魔仙堡 提交于 2021-02-07 20:01:27
问题 I have two WinForm applications that use CR runtime to generate reprts.When CR runtime 13.20 is installed, the newer application will complain that it can't find and load CR 13.21 (13.0.350) assembly. If I upgrade CR runtime to 13.21 (13.0.350) that new application will work but the older one errors out with exception stating that it can't find and load CR runtime assembly 13.20 (13.0.200). All workstations operate on CR runtime 13.20 so how can I make new app created in VS2015 with CR 13.21