my checkboxes are null references
Created at 13 Dec 2023, 09:36
CT
my checkboxes are null references
13 Dec 2023, 09:36
hey there,
At one point in my code I have this:
var chkboxSells = new CheckBox
{
Text = "Sells",
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Center,
IsChecked = false
};
and later on i have this..
var includeSells = chkboxSells.IsChecked;
but i've also tried this and a zillion variations..
var includeSells = chkboxSells != null && (bool)chkboxSells.IsChecked;
in the first attempt i get crashes due to null object references, and in the 2nd I can never get a checkd result to come through as true
Can anyone help me understand how to handle this?
firemyst
15 Dec 2023, 07:46 ( Updated at: 15 Dec 2023, 14:58 )
Duplicate:
https://ctrader.com/forum/calgo-support/42506
@firemyst