Click here to Skip to main content
15,894,405 members
Home / Discussions / C#
   

C#

 
QuestionSelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463763-Aug-18 22:32
Member 138463763-Aug-18 22:32 
AnswerRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff3-Aug-18 22:40
mveOriginalGriff3-Aug-18 22:40 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463763-Aug-18 23:11
Member 138463763-Aug-18 23:11 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff3-Aug-18 23:22
mveOriginalGriff3-Aug-18 23:22 
QuestionRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Eddy Vluggen3-Aug-18 23:41
professionalEddy Vluggen3-Aug-18 23:41 
AnswerRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff4-Aug-18 0:04
mveOriginalGriff4-Aug-18 0:04 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Eddy Vluggen4-Aug-18 0:17
professionalEddy Vluggen4-Aug-18 0:17 
AnswerRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463764-Aug-18 2:21
Member 138463764-Aug-18 2:21 
It's not for any company, just my own little project to make life easier Wink | ;)
In general the purpose of this program is going to be calculating the stirrup spacing and longitudinal reinforcement in a concrete beam subjected to shear and torsion.

Btw, I have another problem to solve... is there any easy way to create method inside a class that would automatically add a property of this instance to a list?

For example I have a class:

class Beton
   {
       public string Label { get; set; }

       public double Fck { get; set; }

       public double Fcm { get; set; }

       public double Fctm { get; set; }

       public double Ecm { get; set; }

        //some constructor
          {
         //add the newly created instance of parameter Label to the new List<string>
          }
   }


Now I want to make 3 instances of this class:

Beton B20 = new Beton();
B20.Label = "C16/20 (B20)";
B20.Fck = 20;

Beton B25 = new Beton();
B25.Label = "C20/25 (B25)";
B25.Fck = 25;

Beton B30 = new Beton();
B30.Label = "C25/30 (B30)";
B30.Fck = 25;


and I want that the list below would be automatically created when I instantiate a class:

List<string> comboBoxList = new List<string>();
comboBoxList.Add(B20.Label);
comboBoxList.Add(B25.Label);
comboBoxList.Add(B30.Label);
comboBoxList.Add(B37.Label);


Is this possible?
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff4-Aug-18 2:28
mveOriginalGriff4-Aug-18 2:28 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463764-Aug-18 3:18
Member 138463764-Aug-18 3:18 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff4-Aug-18 3:30
mveOriginalGriff4-Aug-18 3:30 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463764-Aug-18 11:39
Member 138463764-Aug-18 11:39 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff4-Aug-18 21:52
mveOriginalGriff4-Aug-18 21:52 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463765-Aug-18 1:16
Member 138463765-Aug-18 1:16 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff5-Aug-18 1:28
mveOriginalGriff5-Aug-18 1:28 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Eddy Vluggen5-Aug-18 5:54
professionalEddy Vluggen5-Aug-18 5:54 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff5-Aug-18 6:07
mveOriginalGriff5-Aug-18 6:07 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Eddy Vluggen5-Aug-18 10:49
professionalEddy Vluggen5-Aug-18 10:49 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463766-Aug-18 9:18
Member 138463766-Aug-18 9:18 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff6-Aug-18 21:50
mveOriginalGriff6-Aug-18 21:50 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 138463767-Aug-18 3:23
Member 138463767-Aug-18 3:23 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Richard Deeming7-Aug-18 3:55
mveRichard Deeming7-Aug-18 3:55 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
OriginalGriff7-Aug-18 4:10
mveOriginalGriff7-Aug-18 4:10 
SuggestionRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Richard Deeming7-Aug-18 4:57
mveRichard Deeming7-Aug-18 4:57 
GeneralRe: SelectedIndex doesn't work with the SelectionChanged event handler but it works with the ButtonClick event handler. Pin
Member 1384637619-Aug-18 3:28
Member 1384637619-Aug-18 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.