vb.net - getting a color from a database entry and applying it to a label background -


i having trouble getting color user picks , saving database when reload program automatically apply labels background.

i have let user chose color

private sub button7_click(byval sender system.object, byval e system.eventargs) handles button7.click     if colordialog1.showdialog = dialogresult.ok         quiz.ltitle.backcolor = colordialog1.color     end if end sub 

then have button save code far

private sub btitlesave_click(byval sender system.object, byval e system.eventargs) handles btitlesave.click     backgroundwork.title_settingsbindingsource.addnew()     backgroundwork.title_bcolortextbox.text = quiz.ltitle.backcolor.toargb      backgroundwork.title_settingsbindingsource.endedit()     backgroundwork.title_settingstableadapter.update(backgroundwork.quizsettingsdataset) end sub 

backgroundwork form have databases running quiz form see.

any appreciated

you can try colorinhex ...

private sub btitlesave_click(byval sender system.object, byval e system.eventargs) handles btitlesave.click     backgroundwork.title_settingsbindingsource.addnew()     backgroundwork.title_bcolortextbox.text = quiz.ltitle.backcolor.toargb.tostring("x")      backgroundwork.title_settingsbindingsource.endedit()     backgroundwork.title_settingstableadapter.update(backgroundwork.quizsettingsdataset) end sub 

when called ..

dim scolor string = ... -> retrieve database  quiz.ltitle.backcolor = system.drawing.colortranslator.fromhtml(scolor) 

hope works !


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -