pretty new programming. i've managed come change colour of button once it's pressed. i'm trying text of button clicked on using string chosenroom
, once come save, value of string nothing must doing wrong.
private sub changecolor(sender object, e eventargs) dim senderbutton button = sender if yellowbutton isnot nothing yellowbutton.backcolor = me.backcolor end if if senderbutton isnot yellowbutton senderbutton.backcolor = color.yellow chosenroom = senderbutton.text end if yellowbutton = sender end if end if
this using save string
cmd1.parameters.add(new oledbparameter("room number", ctype(chosenroom, string)))
maybe in code help. put buttons on form and...
private sub button1_click(sender object, e eventargs) handles button1.click, button2.click, button3.click each ctr control in controls if typeof sender button dim mybutton button = ctype(sender, button) if mybutton.text = "button2" mybutton.backcolor = color.red mybutton.enabled = false exit end if end if next end sub
notice handles clause. if not responding event writing own sub pass sender argument looks responding event in case need use handles clause. boy, did not work. i'll try again
turned on option strict , didn't assuming sender button though checked typeof. had ctype mybutton.
Comments
Post a Comment