How to check valid object in PropertyDescriptor?

I'm working in WinForms application and used the BindingList datasource. I need to check the whether the object is valid or not with PropertyDescriptor. because PropertyDescriptor.GetValue(object obj) will works for valid object. but sometimes i has...
more »

2017-03-07 14:03 (1) Answers

c# - How to deal with decimal

I have a numericUpDown and set the decimal places on properties to 3 so it became 0.000 Here is the code Decimal inputGrossWeight = numGrossWeight.Value; if (inputGrossWeight = 0.000) { MessageBox.Show("Gross Weight must be filled!"); } else ...
more »

2017-02-21 10:02 (1) Answers

C# WinForm Scintilla Find Text

Good day all, Below code is for a normal richtextbox to find all text as per 'search for' string. I'm using Scintilla and have tried to convert as far as possible for it to work. It works but not as it should. Any suggestions please? public static ...
more »

2017-02-15 20:02 (0) Answers

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