Changing backcolor of a textbox
-
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?
-
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?
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.
-
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?
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 aDirectCast
in the handlers.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
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.