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
Post a Comment