7 Replies - 1716 Views - Last Post: 21 July 2009 - 10:08 PM Rate Topic: -----

#1 Yaroslav94  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 294
  • Joined: 15-July 09

How can i make listbox1 item copy itself to texbox1

Posted 21 July 2009 - 09:07 PM

How can i make listbox1 item copy itself to texbox1(no using if in texbox1)

 idk what to do im lost

This post has been edited by Yaroslav94: 21 July 2009 - 09:20 PM

Is This A Good Question/Topic? 0
  • +

Replies To: How can i make listbox1 item copy itself to texbox1

#2 LoveIsNull  Icon User is offline

  • Recovering D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 646
  • Joined: 10-March 09

Re: How can i make listbox1 item copy itself to texbox1

Posted 21 July 2009 - 09:20 PM

Use the ListBox's SelectedIndexChanged event.
Private Sub lstBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstBox.SelectedIndexChanged
		txtBox.Text = lstBox.Text
End Sub

This post has been edited by LoveIsNull: 21 July 2009 - 09:20 PM

Was This Post Helpful? 0
  • +
  • -

#3 Yaroslav94  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 294
  • Joined: 15-July 09

Re: How can i make listbox1 item copy itself to texbox1

Posted 21 July 2009 - 09:23 PM

View PostLoveIsNull, on 21 Jul, 2009 - 08:20 PM, said:

Use the ListBox's SelectedIndexChanged event.
Private Sub lstBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstBox.SelectedIndexChanged
		txtBox.Text = lstBox.Text
End Sub

It doesnt work! ?
Was This Post Helpful? 0
  • +
  • -

#4 LoveIsNull  Icon User is offline

  • Recovering D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 646
  • Joined: 10-March 09

Re: How can i make listbox1 item copy itself to texbox1

Posted 21 July 2009 - 09:27 PM

I am sorry, wrong property but the event is what is more important.
	Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
		TextBox1.Text = ListBox1.SelectedItem.ToString
	End Sub

Was This Post Helpful? 0
  • +
  • -

#5 Yaroslav94  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 294
  • Joined: 15-July 09

Re: How can i make listbox1 item copy itself to texbox1

Posted 21 July 2009 - 09:42 PM

View PostLoveIsNull, on 21 Jul, 2009 - 08:27 PM, said:

I am sorry, wrong property but the event is what is more important.
	Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
		TextBox1.Text = ListBox1.SelectedItem.ToString
	End Sub

Still not working.... notin else except for this:
Posted Image
Was This Post Helpful? 0
  • +
  • -

#6 PDUNZ  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 43
  • View blog
  • Posts: 372
  • Joined: 17-July 09

Re: How can i make listbox1 item copy itself to texbox1

Posted 21 July 2009 - 09:52 PM

Show Listbox item in Text box TextBox1.Text = ListBox1.SelectedItem using listbox's SelectedIndexChange


Textbox to Listbox ListBox1.Items.Add(TextBox1.Text) using whatever method.


Looking at your screenshot, it looks like it's 'SelectedItems' not SelectedItem...

This post has been edited by PDUNZ: 21 July 2009 - 09:56 PM

Was This Post Helpful? 0
  • +
  • -

#7 Yaroslav94  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 294
  • Joined: 15-July 09

Re: How can i make listbox1 item copy itself to texbox1

Posted 21 July 2009 - 09:58 PM

View PostPDUNZ, on 21 Jul, 2009 - 08:52 PM, said:

Show Listbox item in Text box TextBox1.Text = ListBox1.SelectedItem using listbox's SelectedIndexChange


Textbox to Listbox ListBox1.Items.Add(TextBox1.Text) using whatever method.


Looking at your screenshot, it looks like it's 'SelectedItems' not SelectedItem...

None of it works!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111
Was This Post Helpful? 0
  • +
  • -

#8 PDUNZ  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 43
  • View blog
  • Posts: 372
  • Joined: 17-July 09

Re: How can i make listbox1 item copy itself to texbox1

Posted 21 July 2009 - 10:08 PM

Ok.. hmmmm

In your list box it looks like you have Wingding type characters - correct? and you want them to copy over to the textbox?

If so, and its not copying - does normal text in the listbox copy over?


Just trying to trim it down to work out whats happening.

This post has been edited by PDUNZ: 21 July 2009 - 10:09 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1