Click here to Skip to main content
15,912,204 members

Comments by Ramtin992 (Top 5 by date)

Ramtin992 15-Sep-20 10:17am View    
Yes, I am sure there are so many other ways to do it better, but as you might notice I am pretty new to programming and especially c#. I will try to improve my code. Thanks for your help and also being patient with me.
Sure I will vote.
Ramtin992 15-Sep-20 9:48am View    
I have done this:
checkedListBox1.Items.Add($"{row[1]}>>\tMax Tons: {row[3]}");
It is working perfectly.
Thank you.
Ramtin992 14-Sep-20 21:06pm View    
Thanks again for your help. I could fix it.
I should mention that I really liked your idea.
Also this part is great :
checkedListBox1.Items.Add($"{row[1]}\t\tMax Tons: {row[3]}");
There is a weird problem here, it is working but in a weird way
There are 13 items that populate in the checkelistbox and all of them are aligned with eachother except for two of them, it seems that those to items do not accept the " \t\t" in the code and attache to the {row[1]}.
If it happened for all of them I thought that I have done something wrong, but it is just for 2 items that happend always. Those two does not align with the rest of the items.
Ramtin992 14-Sep-20 13:22pm View    
Thanks for your response.
No, the user does not have to put a number there, it is optional to refine the results if he or she wants.

I got an error for this section:
string csel = comboBox1.SelectedValue.ToString();
it says: Object reference not set to an instance of an object
How can I fix this? I know the reason but how can I fix it?
I have comboBox1.SelectedItem = null; as I want the combobox be null at the beginning of the program.
Ramtin992 13-Sep-20 15:19pm View    
Could you please explain a little more? I am pretty new to c#
Thank you.