Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Changing Colors At Runtime.


I am having 100 odd forms in my application and there are average 25 controls like textbox,
labels, Picture control etc. on each form.

I want to implement color themes in my application. i.e. the user will choose the theme he would
like to work from the Options Menu and based on his preference I want to change the backcolor
and forecolor properties of each form when the form is loaded.

My questions are:
1. Will it slow down the form loading process if I change the color of each control on form load?
2. Is there another better way of doing stuff like this?



  • EffahidEffahid Member Posts: 15
    HI , i am Effahid ( A Newcomer to the Club , but not to VB) ...
    The answer is simple , how is the user going to change the theme? obviosuly AFTER running the application ? Right? Now suppose the application is currently running and he chooses another theme in the theme dialong box(say) , you can display a form which says "Please Wait While The Theme is Applied" ..... Changing colors won't take TOO much long .So the user can wait for a couple of seconds....
    To change the back color of all the text boxes in the form ,use a loop like this
    dim txtbox as TextBox
    for each txtbox in Me.Controls
    txtbox.BackColor = VBRed
    For questions you can also mail me at:
  • Andre YoungAndre Young USAMember Posts: 0

    __ / / free video tutorials and ebooks about || C++, Swift, Delphi, R, MATLAB, JavaScript, Ruby, C, Assembly, PL/SQL, Go, Objective-C, Python, Java, Visual Basic, Scratch, C#, Visual Basic .NET, Perl, PHP Awk, Lua, ABAP, Crystal, Ada, Erlang, F#, Hack, VBScript, SAS, Logo, Scala, Kotlin, Clojure, Scheme, Apex, COBOL, Dart, D, ML, Julia, Alice, Rust, FoxPro, Prolog, LabVIEW, Lisp, Transact-SQL, Fortran, Bash || _____

Sign In or Register to comment.