Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Changing backcolor of a textbox

Changing backcolor of a textbox

Scheduled Pinned Locked Moved Visual Basic
csharpcomquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CHill60
    wrote on last edited by
    #1

    VB.net is not my strongest forte but I posted this solution http://www.codeproject.com/Answers/764387/TextBox-BackColor-Change#answer4 to a post and it's been downvoted. I don't care about the downvote but I do care if I've led the OP and others astray. Basically I suggested using one function to handle all of the Enter and Leave events...is that bad practise?

    T Richard DeemingR 2 Replies Last reply
    0
    • C CHill60

      VB.net is not my strongest forte but I posted this solution http://www.codeproject.com/Answers/764387/TextBox-BackColor-Change#answer4 to a post and it's been downvoted. I don't care about the downvote but I do care if I've led the OP and others astray. Basically I suggested using one function to handle all of the Enter and Leave events...is that bad practise?

      T Offline
      T Offline
      Tino Fourie
      wrote on last edited by
      #2

      If it does not affect your program execution then probably no. However each event serves a specific purpose and should maybe treated as that. Edit: I just had a quick look at your suggestion and there is absolutely nothing wrong with what you suggested. The upside of that is it reduces the amount for coded lines and since there are 6 textboxes why on earth would I want to navigate past 5 identical Sub's each referring to another similar control. You probably got down voted by a noob who does not really know what all that means.

      C 1 Reply Last reply
      0
      • C CHill60

        VB.net is not my strongest forte but I posted this solution http://www.codeproject.com/Answers/764387/TextBox-BackColor-Change#answer4 to a post and it's been downvoted. I don't care about the downvote but I do care if I've led the OP and others astray. Basically I suggested using one function to handle all of the Enter and Leave events...is that bad practise?

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        I don't see anything wrong with your answer. It's certainly better than any of the others! :) Edit: Apart from the fact that you're relying on Option Strict Off; you should probably add a DirectCast in the handlers.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        • T Tino Fourie

          If it does not affect your program execution then probably no. However each event serves a specific purpose and should maybe treated as that. Edit: I just had a quick look at your suggestion and there is absolutely nothing wrong with what you suggested. The upside of that is it reduces the amount for coded lines and since there are 6 textboxes why on earth would I want to navigate past 5 identical Sub's each referring to another similar control. You probably got down voted by a noob who does not really know what all that means.

          C Offline
          C Offline
          CHill60
          wrote on last edited by
          #4

          Thank you! I've already thanked Richard Deeming as well on his comment to my solution post (which is handy if anyone comes across it)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups