vb.net - How to change buttons on a msgbox using a combo box in visual basic 2010 express? -


i want display msgbox contains information provided combo box. specifically, if combo box contains "warning" want msgbox display warning icon.

basically need know how put input combo box msgbox without having make have msgboxstyle.critical or that.

what thought work:

private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click  if combobox1.selecteditem = "warning"    combooutput = msgboxstyle.critical 

hopefully question clear.

the following should work:

we load enum values on form load. on click parse name , display message box.

private sub form5_load(sender system.object, e system.eventargs) handles mybase.load     combobox1.datasource = [enum].getnames(gettype(messageboxicon)) end sub  private sub button1_click(sender system.object, e system.eventargs) handles button1.click     dim value = [enum].parse(gettype(messageboxicon), cstr(combobox1.selecteditem))     messagebox.show("text", "caption", messageboxbuttons.ok, ctype(value, messageboxicon)) end sub 

Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -