2 Replies - 4680 Views - Last Post: 01 March 2010 - 09:54 PM Rate Topic: -----

#1 jallan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 12-March 09

For Selected Item of Listbox input value in Textbox

Posted 26 February 2010 - 11:40 PM

Sir,

I am using 3 textbox and one listbox. I am successfully retrieve the data into listbox i want that item selected in a listbox enter the data by textbox once the value input that the selected item of a listbox will change the back color of selected item only.

Please help me.

I am appreciate any one answer.


Thanks in advance
Is This A Good Question/Topic? 0
  • +

Replies To: For Selected Item of Listbox input value in Textbox

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4332
  • View blog
  • Posts: 12,127
  • Joined: 18-April 07

Re: For Selected Item of Listbox input value in Textbox

Posted 27 February 2010 - 12:32 AM

I am not sure exactly what you are asking but if you are asking how do you locate an item in your listbox based on the value you type into the textboxes, then try using the IndexOf() method of your listbox's items collection...


' Search listbox items and return the index of the item
Dim indexOfFound as Integer 
indexOfFound = listbox1.items.IndexOf(textbox1.text)

' Select that item in the list if it was found, otherwise do nothing
listbox1.selectedindex = indexOfFound



As for changing that found items color (other than the color used when selected) you can't. Not unless you take over drawing of the control itself which can be quite tedious. :)
Was This Post Helpful? 0
  • +
  • -

#3 jallan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 12-March 09

Re: For Selected Item of Listbox input value in Textbox

Posted 01 March 2010 - 09:54 PM

Sir,

I have successfullly retrieve the data into listbox.

My question is I am using 5 textboxes, 1 listbox and 1 button(this button I have use insert query of database). I want that the 3 textbox value will no leave blank by user it must some value and then 2 textboxes contains value digit and date I want the the remaining 2 textboxes if the user leave blank then enter insert button then the listbox back color will not change and if the user input some value into the 2 textboxes then the listbox selected item or (3 textbox value inserting into the listbox) back color will changed.

Thats my question

so sir please help me.

Thank you
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1