7 Replies - 2654 Views - Last Post: 12 March 2013 - 09:41 PM Rate Topic: -----

#1 josh0709  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 20-February 13

change color of disabled textbox

Posted 10 March 2013 - 09:27 AM

ok i have created a program where when a keydown command is pressed and it moves to the next form but the problem i am having is that when my first form loads the cursor goes into textbox 1 which means i cant perform my keydown command. i have tried disabling the text boxes but that changes the color to grey and i need the color to be the color my client wants

please help
Is This A Good Question/Topic? 0
  • +

Replies To: change color of disabled textbox

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5535
  • View blog
  • Posts: 11,857
  • Joined: 02-June 10

Re: change color of disabled textbox

Posted 10 March 2013 - 09:38 AM

You're building an app for a client in a language that went end-of-life about a decade ago? Should this be moved to VB.NET?

Please read: This is not the VB.NET forum
Please read: Is learning VB6 now a complete waste of time?

If this is *is* .NET you can set the form's KeyPreview to true, then put the Keydown handler in the form instead of the textbox.

But you can't change the color of the disabled textboxes. And disabling them is just a bad patch for the real problem. better to fix the design of the application so as to not cause the issue to begin with.
Was This Post Helpful? 0
  • +
  • -

#3 josh0709  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 20-February 13

Re: change color of disabled textbox

Posted 10 March 2013 - 09:46 AM

using vb6 as it is also part of my college work and the only language we can use (a pain i know but no choice) and can you do that in vb6

This post has been edited by GunnerInc: 10 March 2013 - 10:07 AM
Reason for edit:: Unnecessary quote removed

Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5535
  • View blog
  • Posts: 11,857
  • Joined: 02-June 10

Re: change color of disabled textbox

Posted 10 March 2013 - 10:00 AM

Really? holly sh!t. What country are you in that you're going to school for VB6? I'm going to guess India as I've heard it is still used there.

Honestly, if I were in you're shoes I wouldn't spend the money on it. You can learn a language from this century on-line, and you've shown you have internet access.


My standard beginner resources post - Updated JAN 2013


Plan your study route:
There are three routes people seem to take when learning programming.
  • Just start trying to create programs
  • Start taking apart other programs and try to figure out the language by reverse engineering
  • Follow a guided learning course (school or self-teaching books)


For the life of me I can't figure out why people try 1 & 2. I strongly suggest taking the guided learning approach. Those book authors go in a certain order for a reason: They know what they're doing and they know the best order to learn the materials.

  • First learn the language by working 2-5 "Learn C# in 30 days" type books cover to cover.
  • Do a dozen on-line tutorial projects where you build what you're told to build, the way you are told to build it WITH AN EXPLANATION OF WHY so you can learn.
  • Learn to plan before you type.
  • THEN you start designing software with a purpose.



I don't learn from reading books: I learn by doing.
Spoiler


Newbie/Rookie said:

I have little/no programming experience but I need to write a program by Friday that does XYZ.
Spoiler



Resources, references and suggestions for new programmers.
Spoiler

Was This Post Helpful? 0
  • +
  • -

#5 josh0709  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 20-February 13

Re: change color of disabled textbox

Posted 10 March 2013 - 10:05 AM

no live in England but its just are stupid exam board wanted the projects in vb6. i know java, c#, vb.net and a bit of python but just needed to know this sorry didn't know it was illegal to know a program which was a decade old

This post has been edited by GunnerInc: 10 March 2013 - 10:07 AM
Reason for edit:: Unnecessary quote removed

Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5535
  • View blog
  • Posts: 11,857
  • Joined: 02-June 10

Re: change color of disabled textbox

Posted 10 March 2013 - 10:29 AM

Chill dude. Didn't mean to insult you. Was just shocked to hear anyone was building new apps in this. Maintaining legacy apps, sure. I just couldn't imagine building a new app in it.

Best of luck with it.
Was This Post Helpful? 0
  • +
  • -

#7 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,778
  • Joined: 26-March 09

Re: change color of disabled textbox

Posted 10 March 2013 - 11:56 AM

Slightly confused with what you're after??

If you're capturing the keydown event on the form, then set the KeyPreview property to true and this should enable your form to see the event before the textbox.
Was This Post Helpful? 0
  • +
  • -

#8 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: change color of disabled textbox

Posted 12 March 2013 - 09:41 PM

You can change the BackColor property of the TextBox if you want it to be a different color.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1