c# - Populate a ComboBox on MainForm via Logic.cs -


I was able to enable a combo box through the stream reader on the mainframe. I now feel like I need the same information in several different combo boxes of different dialogues. This task accepts that I can not reach the combo box "CBTsk". Error "in the current context name 'cbTask' does not exist 'code

  public static zero workbook (try {{StreamReader function} = new streamrider (datafolder + task file); string function = Work.readline (); while (work! = Null) {cbTask.Items.Add (task); function = work.readline ();}} hold {}}   

datafolder one The path is the Taskfile file name, and if I leave it on the mainfrom it works well.

Why Can anyone tell me in the right direction? Thanks for watching in advance !! I appreciate it. It's a great day!

EDIT: After reading a few times on this it seems that My question is not clear. I am trying to add information to several combo boxes from Stream Rider on many child communications.

My first answer is to provide an enterprise-style solution, this If you want a simple and a lesser way to handle your challenge, here's another way.

  Public static class MyTaskComboBoxPopulater () {public static zero zero} {try {StreamReader task = new streamrider (datafolder + taskfile); String Functions = Functions Readline (); While (work! = Null) {comboBox.Items.Add (task); Work = task Readline (); }} Hold {}}} public form MainForm () {public static zero task populate () {MyTaskComboBoxPopulater.LoadTasksToCombobox (cbTask); }}    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -