Windows Forms resized after loading WPF

I'm experiencing a strange behavior, one for which I currently do not have an explanation or a solution and I'm hoping someone knows something about this. So I have a simple Windows Forms application with a single button, which on button click will ...
more »

2017-06-11 12:06 (1) Answers

How to fill ContextMenuStrip in XAML?

I've created WPF application with NotifyIcon to work in tray. public partial class MainWindow : Window { public NotifyIcon NotifyIcon { get; } = new NotifyIcon { Icon = Properties.Resources.status_on_ico, Visible = true }...
more »

2017-06-06 14:06 (1) Answers

Searching in a listBox using backgroundWorker

This is a C# - WinForm question: I'm trying to search in a listBox. There's ONLY ONE listBox full of some items. On program load, all the items in the listBox, get copied into a List of type string called 'tempList'. There's also a TextBox. When the...
more »

2017-05-06 10:05 (2) Answers

How to handle System.OverflowException

I have one simple windows application in that amount Textbox is there. When i enter amount into amount textbox it will convert it to words in another textbox named txtrupees. Amount Textbox field maximum length is set to 11 places in that last 3 plac...
more »

2017-04-26 12:04 (2) Answers

Can't get App.config settings to persist

Problem: Value set by user on initial startup won't stay in App.config xml Desired functionality: Value set by user to stay stored in App.config unless changed by user I'm trying to make it so that the first time the application is run by the user ...
more »

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

C# SQL connection string best practice

I have a winforms application that connects to a database with a connection string and a generic user "Database=DBADAS;Server=TMT123\\SQLEXPRESS;User ID=user; Password=*****; After connecting into the database with a login dialog, we check if the ...
more »

2017-04-12 09:04 (2) Answers

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