C# control.find explanation

so i have been using the control.find for a while now, and it works like a charm. I like to understand the things that i use. Control txt = this.Controls.Find(x + "_" + y + "_" + z, true)[0] as TextBox; txt.Text = string.Empty; The above is an exa...
more »

2017-02-07 10:02 (2) Answers

Kinect V1 c# cant display image properly

The code worked fine on C# WPF application but is not able to display image properly on Windows Form application as I cant create a writable bitmap in Form application so tried to create Bitmap from bytes using Lockbits and Marshal Copy method. Is th...
more »

2017-02-04 18:02 (1) Answers

C# Search for first number in integer/string

I have a textbox where people have to enter a number but I don't want to them to type the number 0 in first, how do I do this? Example: If they type, 10 it's ok but if they type 010 it's not ok and I want a window to appear and tell them to try agai...
more »

2017-02-02 12:02 (6) Answers

write/update local data base from datagridview

i have a problam to insert data from datagridview to local data base, in my program - im uploading from csv/excel file data to datagridview and showing it to the user . i have 3 localDB in my program that connected to each other by foreign keys and ...
more »

2017-01-25 10:01 (1) Answers

C# Task.Run slowing my wpf program

Short story: I am designing software to validate some things in a CAD application. When I try parallelism it gets very slow in WPF only. Long story: I have my software that asks questions of my library (.dll) that I also made and that library commun...
more »

2017-01-25 02:01 (2) Answers

ListBox not updated via DataSource

I have a ListBox which has its DataSource set to a BindingList. BindingList<PairDiff> pairList = new BindingList<PairDiff>(); pairList.RaiseListChangedEvents = true; listBox1.DataSource = pairList; The type of the BindingList implement...
more »

2017-01-08 20:01 (2) Answers

Append clipboard text to a listbox

So I created a variable to hold my clipboard text and I have no idea on how to append it to a listbox. This is as far as I got.. private void clipboardBtn_Click(object sender, EventArgs e) { string items = Clipboard.GetText(); List<strin...
more »

2017-01-01 23:01 (5) Answers

Send notification on Time/Date from database

I'm trying to figure out how to make my application send a notification on the specified date/time which it retrieves from my database. it does not need to do anything complicated like a pop-up/sound notification it just needs to send a simple mes...
more »

2016-12-28 15:12 (1) Answers

Winforms c# app on datagridview binding

I have a WinForms application and would like to bind an XML file to a DataGridView. On the first 2 rows of the DataGridView I need to append a timespan (HH:MM) time format. How do I achieve this, so that in addition all the rows are editable? What wo...
more »

2016-12-25 23:12 (1) Answers

How to save an object after exit

So I'm currently working with VB.net and winforms and I need the have objects created from my classes saved so they are still there if I exit the program and open it again. I also needed to make them dynamically so I was going to add them to a dictio...
more »

2016-12-22 02:12 (1) Answers

70% Opacity Color to a Button WinForms

I want to make that effect when I hover a button to still be like 30% transparent (so you can see the background image from the form) but still see some color.. I tried this but this just gives me a blank black: private void roundedButton2_MouseEnt...
more »

2016-12-17 23:12 (1) Answers

Converting int to string with a specific format

I'm trying to convert an classical integer value like: 2000 into a format like this: 2.000,00 I have tried the following methods: String.valueOf(input.format()); And this method: private String getCents(Decimal x){ String y = String.val...
more »

2016-12-14 15:12 (2) Answers

How to update a value in local SQL Server database

In my program I want the user to have the option to change the value (price in my example) in a local database, that I created. I'm having a problem with it. The connection works fine and it debugs well and even shows the message that "saving ok", b...
more »

2016-12-04 19:12 (1) Answers

Invert text color depending on BackColor

I have a ProgressBar control like the following two: The first is painted properly. As you can see, the second only has one 0, it's supposed to have two but the other cannot be seen because ProgressBar's ForeColor is the same as the TextColor. Is ...
more »

2016-12-04 00:12 (1) Answers