How to show a label after same second in a VB.NET -
i wondering how in vb.net. imagine have form has 4 labels hidden. want show them 1 after each other delay. example, when run app first show first label after 5 second show second 1 , after 5 second show other 1 , on. know should use timer , write code in tick don't know how. tell me timer code. can rest of that.
assuming winforms? 1 way done...
public class form1 private labelsenumerator ienumerator private sub form1_load(sender object, e eventargs) handles mybase.load dim labels() label = {label1, label2, label3, label4} each lbl label in labels lbl.hide() next labelsenumerator = labels.getenumerator timer1.interval = timespan.fromseconds(5).totalmilliseconds timer1.start() end sub private sub timer1_tick(sender object, e eventargs) handles timer1.tick if not isnothing(labelsenumerator) if labelsenumerator.movenext labelsenumerator.current.show() else timer1.stop() end if end if end sub end class
Comments
Post a Comment