A simple Clear All Controls on Form -- Just 4 Lines!
Need to perform the same action on multiple controls in your form? Then this simple code might just be for you.. This particular example will show you the most efficient way to clear every text box on a form. This method can be especially useful if you're adding and removing controls during the development of a project.
AI
Riepilogo AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Codice sorgente
<br><br>I guessed there must be a better way than hard-coding each control name, but I searched PSC and couldn't find anything to do the job. So after I worked it out I felt this simple method should be added to PSC so those who don't already know how to do it can benefit too. <br><br> <br><blue>Dim <black>Control <blue>As <black>Control <br><blue>For Each <black>Control <blue>In <black>Me <br> <blue>If TypeOf <black>Control <blue>Is <black>TextBox <blue>Then <black>Control.Text = "" <br><blue>Next <black>Control <br><br><br>Please vote if you learnt something useful.<br><br><red>Cor!™<black><br><br>
Commenti originali (3)
Recuperato da Wayback Machine