473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to change the color of textbox at runtime in VB?

123 100+
Hello,

Please can anyone suggest me code to change the color of textbox at runtime in VB?
Feb 23 '07 #1
2 2037
vijaydiwakar
579 512MB
Hello,

Please can anyone suggest me code to change the color of textbox at runtime in VB?
txt.backcolor=rgb(255,0,0)
txt.forecolor=vbblack
Feb 23 '07 #2
vijaydiwakar
579 512MB
Hello,

Please can anyone suggest me code to change the color of textbox at runtime in VB?
Shailja
yesterday i suggest u to use itemdata of combo box
due to lack of time i'm unable to give u code
now try this
this code is bug free and have lavel of erp standards
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboMode_DropDown()
  2.  
  3.     Dim sSql        As String
  4.     Dim Rsdata      As New ADODB.Recordset
  5.     sSql = ""
  6.     sSql = "Select CompID , CompName From Company"
  7.     Rsdata.Open sSql, c_Cnn, adOpenForwardOnly, adLockReadOnly
  8.     cboMode.Clear
  9.     While Not (Rsdata.EOF Or Rsdata.BOF)
  10.         cboMode.AddItem Rsdata!CompName & ""
  11.         cboMode.ItemData(cboMode.NewIndex) = Rsdata!CompID & ""
  12.         Rsdata.MoveNext
  13.     Wend
  14.     Set Rsdata = Nothing
  15. End Sub
  16.  
  17. on change event of combo write
  18.  Dim sSql        As String
  19.     Dim Rsdata      As New ADODB.Recordset
  20. ssql=select * from table where compid=" &  Val(cbomode.ItemData(cbomode.ListIndex))
  21. ' write the code here
  22.  
Feb 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Roberto Castro | last post by:
Hello! I have been assigned for the first time an adp Access project and so far I have managed to make the changes needed for some requirements. However, I am struggling to find the place where...
4
by: codemonkey | last post by:
TIA! I would like to know if there is a way to dynamically change the colors of Subform items? I have already set in place Conditional Formatting so each row has an alernating color scheme, but...
10
by: tshad | last post by:
I have a problem setting the background color of textbox on the fly. I tried using: applicantID.backcolor = "F6F6F6" and applicantID.backcolor = "#F6F6F6"
1
by: Mohamed elmalt | last post by:
Hello, does anyone know how to let the uses of my programm change the size of the text box dynamically? exactly like the ide lets us design the textbox i'd like to let the users of my program...
3
by: Darin | last post by:
Is there a way to, at runtime, change a textbox to be a datetimepicker? I have a form that I allow the user to specify what field types the input boxes are. They can be regular text, integer,...
8
by: Radek Budař | last post by:
Hi all, i have trouble with changing text value of textbox on runtime. I use this control to display process information about sending e-mail per smtp. I use external component >>Imports...
10
by: Marc R. | last post by:
Hi all, I edit records using a form that have multiple control bind on Dataview, But I don't want to update right always to database, I would like to delay until all Changes (add all new...
0
by: zeng.hui.stephen | last post by:
I download the demo http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/. I inherite the demo, and write my code. I want to use Hook to monitor C++ Edit change. I use a C# form...
3
by: RSH | last post by:
Hi, Is it possible to change the type of controls at run-time? In other words I have a form with TextBoxes etc. on it. If the user only has readonly privelages I was wondering if I could...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.