Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

What do you mean, "create"? Do you want to make your own

custom control from scratch, or do you just want to stick a

ListBox control on your form? And what do you mean by "linkabble"?

Linkable to what?

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

  • *Experts*
Posted

Listboxes are already scrollable... what do you mean linkable? Do you mean so that two listboxes that syncronise their scroll positions?

 

I think you'll need to do some of that old fasioned subclassing; create your own class which inherits the ListBox class, and override its WndProc method -- you'll need to capture the WM_VSCROLL event (I *think*) and send the same message to the other listbox.

Posted
what i mean is i wont to create a list of words. And when they click on a word this will trigger an event, but its a long list to i also wont the user to be able to scroll through all the words
  • *Experts*
Posted

ListBoxes are scrollable by default... just add more words than it can handle and it will scroll.

 

To make it so that clicking one of the items does something, you need to use the SelectedIndexChanged event, and check the value of ListBox1.SelectedIndex (for the index) or ListBox1.Items(ListBox1.SelectedIndex) (for the text) to see what was clicked.

  • *Experts*
Posted

I know Volte is probably going to beat me to this, as he types

about ten thousand WPM, but what you're trying to do is very

simple. The ListBox control is already scrollable when the items in

it are longer than the listbox.

 

To make it "linkable", all you need to

do is add code in the SelectedIndexChanged event. Add a

Select Case statement inside the event handler to check the

value of the SelectedIndex property to see which item was

clicked, and act appropriately.

 

[edit]Waaaaaaaaay too slow, even for the response. Gah.[/edit]

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Posted
hmmm, maybe there is a simple solution to this BUT i dont know it off the top of my head. How do i tell it whent he tabpage 2 is click to start doing what you just said and when the tabpage 2 is no longer active to stop doing it?
  • *Experts*
Posted

The TabControl has the same event as the ListBox, that is,

SelectedIndexChanged. Add code in here that, if the selected

index is 1 (the second tab), loop with a call to DoEvents in the

loop until the SelectedIndex changes to something else.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

  • *Experts*
Posted
Stop doing what? Just put
If TabControl.SelectedTab is TabPage2 Then 'I'm not sure of the exact syntax of this
 'do whatever it is you want to do
End If

It's not that hard, really. :)

  • *Experts*
Posted

You need to change "TabControl" to the actual name of your

control.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...