vb.net - Show message as a table in VB -


i new in programing , have design project part of uni project ... have completed 70% of design show massage table.

should have database ??? ... how can link message ??

my code

 private sub button2_click(byval sender system.object, byval e system.eventargs) handles button2.click         if textbox1.text = nothing messagebox.show("please, find calories first")         if textbox1.text > "2400" or textbox1.text > "2300" messagebox.show("what should write here????") 

should have database ???

not sure mean table.... couple of points way...

you should abstract code button click, way can re-use on event. create new sub , call button click this

private sub button2_click(byval sender system.object, byval e system.eventargs) handles button2.click      calorieschecker()  end sub 

this method re-written case statement, integer variable "calories" has been assigned text box, ensure can evaluate number.

using case statement can set boundaries calorie.... sorry, i'm not sure mean table.

private sub calorieschecker()      dim calories integer = textbox1.text     dim message string      select case calories         case ""             message = "please, find calories first"         case > 2300             message = "whatever want say"     end select      messagebox.show(message)  end sub 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -