|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
About Adding controls dynamicallyhello
i want to add some controls in according of the time. but when the time change, i call the method again to add controls again,No effect! i think maybe i should unload the controls adding before,how can i unload it?? pls help me,thanks Crazyjh,
For using dynamic controls it is important to know if it is about a webpage or a winform. They act completely different in this, so let us know that to make the answers not only confusing. Cor Show quoteHide quote "crazyjh" <craz***@gmail.com> schreef in bericht news:eU5Mz9fuGHA.736@TK2MSFTNGP02.phx.gbl... > hello > > i want to add some controls in according of the time. > but when the time change, i call the method again to add controls again,No > effect! > i think maybe i should unload the controls adding before,how can i unload > it?? > > pls help me,thanks > thanks for your reply
the development based on vb.net2005 + winform ----- Original Message ----- From: "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> Newsgroups: microsoft.public.dotnet.languages.vbSent: Monday, August 07, 2006 6:09 PM Subject: Re: About Adding controls dynamically Show quoteHide quote | Crazyjh, | | For using dynamic controls it is important to know if it is about a webpage | or a winform. They act completely different in this, so let us know that to | make the answers not only confusing. | | Cor | Crazyjh,
The oposite from adding a control is the control.remove http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.controlcollection.remove.aspx I hope this helps, Cor Show quoteHide quote "crazyjh" <craz***@gmail.com> schreef in bericht news:OkdCqIguGHA.4612@TK2MSFTNGP02.phx.gbl... > thanks for your reply > > the development based on vb.net2005 + winform > > > > > ----- Original Message ----- > From: "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> > Newsgroups: microsoft.public.dotnet.languages.vb > Sent: Monday, August 07, 2006 6:09 PM > Subject: Re: About Adding controls dynamically > > > | Crazyjh, > | > | For using dynamic controls it is important to know if it is about a > webpage > | or a winform. They act completely different in this, so let us know that > to > | make the answers not only confusing. > | > | Cor > | > thanks
i used the sentences below,it appearly doesn't work! lbl is dynamic added in a function a,next time when i called a,the "if" statement don't work at all dim lbl(i) as label lbl(i) = new label If (me.Contains(lbl(i))) Then me.Controls.Remove(lbl(i)) End If "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.controlcollection.remove.aspxnews:%23jXzVkguGHA.1296@TK2MSFTNGP02.phx.gbl... | Crazyjh, | | The oposite from adding a control is the control.remove | Show quoteHide quote | | I hope this helps, | | Cor | crazyjh,
You have to remove the original added control. This lbl(i) is a complete new label that is never in your control collection as long as you don't add it. You can as well use the removeAt. http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.controlcollection.removeat.aspx Be aware that this reindexes the index. Cor Show quoteHide quote "crazyjh" <craz***@gmail.com> schreef in bericht news:%23j0tOsguGHA.1296@TK2MSFTNGP02.phx.gbl... > thanks > > i used the sentences below,it appearly doesn't work! lbl is dynamic added > in > a function a,next time when i called a,the "if" statement don't work at > all > > dim lbl(i) as label > lbl(i) = new label > If (me.Contains(lbl(i))) Then > me.Controls.Remove(lbl(i)) > End If > > "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message > news:%23jXzVkguGHA.1296@TK2MSFTNGP02.phx.gbl... > | Crazyjh, > | > | The oposite from adding a control is the control.remove > | > http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.controlcollection.remove.aspx > | > | I hope this helps, > | > | Cor > | > "crazyjh" <craz***@gmail.com> schrieb: You can remove the control from the container's (form, control) 'Controls' > i want to add some controls in according of the time. > but when the time change, i call the method again to add controls again,No > effect! > i think maybe i should unload the controls adding before,how can i unload > it?? collection. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Update problem ADO vbnet 2005
Getting database fields (rows) to appear as columns in datagrid Altering function of keypress for listbox Convert DAO from VB6 to VB8? Hyperlink and Label Update a structure when another structure changes Showing a form from within a thread Cache panels Route planning Newbie help with the imports statement |
|||||||||||||||||||||||