vb.net - Visual basic - trying to delete a value from a combo box -
i trying remove value combobox, combobox on layout panel. i'm getting value should removed database has been linked, know connection database works (i copying form part of program) cant find correct way remove combobox. line causing issues :
'if date in data on week ahead data not displayed' if bookingday = "monday" , ((bookingdate - today()).totaldays < 7) me.tablelayoutpanel1.controls("cbomonp" & period).remove = room if length > 1 me.tablelayoutpanel1.controls("monp" & period + 1).remove = room end if end if
remove member of items collection of combobox, not of combobox itself. also, it's method, not property, call , pass item remove rather assigning item it.
directcast(me.tablelayoutpanel1.controls("monp" & period + 1), combobox).items.remove(room) if have option strict on, should, cast required because control reference form controls collection , doesn't have items property.
Comments
Post a Comment