c# - can't use textbox outside MainWindow method -


I am trying to create an integer which contains numbers in box 1 (in wpf). But the compiler will not allow me to compile my code. Am I wrong?

  public partial square main window: window {public main window} {starting object (); } Private intakes () {int var1 = int.Parse (box1.Text); }}  

has the error:

wpfapplication1.mainwindow.addValues ​​do not return all code paths a value

  private int addValues ​​() {int var1 = int pars (box1.Text); Return var1; }  

Its a non-sensible, returning method but there is no value.

Make it sensible as such,

  private zeros addValues ​​() {int var1 = int.Parse (box1.Text); }  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -