Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Listbox Scrollbar Disappears When I Resize It


If I resize a listbox using it's height property, it's scrollbar disappears for some reason. How can I prevent that or make it reappear ?

An example:

I use the AddItem method to add items to the ListBox, and when the window is filled up, the vertical scrollbar appears by itself and does its job. However when i resize the ListBox by modifying the Height property of the ListBox, the scrollbar vanishes and never comes back.

What am I not doing right ?

Please help. This is getting annoying




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
When Moving Item Down In The Listbox The Text Disappears
Okay dont know why but the text is dissapearing when an item is moved down the list box.

Image1 displays before the move down
Image2 displays after the move down
Code is also attached. I am very confused I have been through this code througherly and I am sure there is not an error in the code.




Code:
' check: only proceed if there is a selected item
' check: last item can't be moved down
' save items text and items indexvalue
' remove item
' place item back on new position
' if you keep that item selected
' you can keep moving it by pressing cmdDown
' for arLoopCount adds the new playlist entrys from
' lstPlayList.
' list1 refreshes
' lstPlayList refreshes
Dim tempStr As String
Dim iIndex As Integer
Dim arLoopCount As Integer
List1.Clear ' Debugging orriented object to display the contents of arFilePlayList Array
If lstPlayList.SelCount = 1 Then
If lstPlayList.ListCount - 1 = lstPlayList.ListIndex Then
Exit Sub
Else
tempStr = lstPlayList.List(List1.ListIndex)
iIndex = lstPlayList.ListIndex
lstPlayList.RemoveItem lstPlayList.ListIndex
lstPlayList.AddItem tempStr, iIndex + 1
lstPlayList.Selected(iIndex + 1) = True
End If
End If
For arLoopCount = 0 To lstPlayList.ListCount
arFilePlayList(arLoopCount) = lstPlayList.List(arLoopCount)
List1.AddItem arFilePlayList(arLoopCount)
Next arLoopCount
List1.Refresh
lstPlayList.Refresh

Hooking My Scrollbar To A Scrollbar-less Listbox
I know there's a way to do this, but I can't find the code for it. Does anyone know where I can find the Subclassing code to hook my scrollbar to a listbox, on which I have removed it's scroll bar so that I may use my own. My scrollbar has a variable for percent, if that is needed. I want it to be able to have the user scroll my scrollbar and the listbox scrolls down. Any suggestions?

ListBox With Multiline**SOLVED WITH LISTBOX HORIZONTAL SCROLLBAR***
Hi
when i type a text into Text1 and press command1, it adds text1.text to list1

what can I do if the text in text1 is bigger than the space in List1

:/

thanks

Scrollbar On Listbox
I know this is a totally a weird idea
How do you put a scroll bar on a list box???

Listbox Scrollbar
I
is there a way to put an horizontal scrollbar in a listbox?
thanks

Scrollbar And Listbox
i got a listbox(List1) and a Vertical scroll bar(Scroll1)

i was wondering how do i scroll scroll1 and the list1 auto scrolls?
basically its a scrollbar with the list1

Listbox Scrollbar
Hi All...

I just hate the default listbox control.

Is it possible to change the Vertical Scrollbar / Make my own images for it?
I made a nice design for my application, And the listbox has the *ugly* windows-style. (Subclassing?)

Greetz Kevin,

Listbox Scrollbar API
Hi All,
Thanks god for having this forum with experts like you all around to help. Anyway, I am not sure if this thread suppose to be in this catgory or API, anyhow ... here is my problem.

Problem :
I have a listbox with many data in the list. The objective is to set the focus on the selected text to be in the middle of the listbox. To do so, I uses this code

Private Sub List1_Scroll()
'mintmiddle is half of the total visible count of items in the listbox
List1.ListIndex = List1.TopIndex + mintMiddle
End Sub

However, with this code whenever I trigger a scolling, it also triggers the event list1_click(). Whenever list1_click() happens it triggers certain query which is slowing down the process of scrolling. This is particular worst if the user were to click and hold onto the down arrow of the scroll bar.

*What I want, is to find a method where I can track mouse left button down when scrolling then I dun do the above listindex change, only after the mouse button up then I trigger the listindex change.

List1_mousedown and list1_mouseup .... form_mousedown and form_mouseup ... doesn't work ....

Can anyone help me with this problem ???

Million thanks !!!

ListBox - ScrollBar
Hi There,

I have a listbox and don't want to use its ScrollBar. I am creating a new seperate VScrollBar and wondering if any of you guy show me how to make it works with the listbox.

Thanks

ListBox ScrollBar Value?
Is there a way to get the value of a list box scroll bar?

I want to detect which item the mouse is over. I divide the Y coordinate by the row height to get the list index. But if there is a scroll bar, I need to know the position of the scroll bar to know how much to add to the index. (I'm doing this in VBA and I can't get API calls to work to get the actual item number.)

Listbox And Scrollbar
Hi,

As you know, a scrollbar automaticaly appears on a listbox.

I'm just trying to detect in my app. when this scrollbar appears, thats all...

Thanks.

No Scrollbar In A Listbox
Hi,

Is it possible to have a listbox without a vertical scrollbar, when the list becomes longer then the lenght of the listbox?

Thanx, Maarten

Horizontal Scrollbar On Listbox
I've looked through the horizontal scrollbar listings that I've seen in this forum and none of them seem to address what I am looking for. I have a macro in Excel that uses a listbox inserted into a form from the Toolbox. The width is wider than 75, which I found out is a threshold from looking at another thread. Is there a way to make the horizontal scroll bar show up even when the listbox is wider than 75?

Thanks

A Horizontal Scrollbar For Listbox ? Vb6
Is it possible ? if how ?

thnx, bye.

Getting Rid Of Horizontal Scrollbar In Listbox
Hi all. Does anyone know how to get rid of the horizontal scrollbar in a listbox. I tried changing the width and it didnt work.

Thanks.

Listbox And Horizontal Scrollbar
I have a listbox. Is it possible to attach a horizontal scrollbar to the bottom of the listbox to allow it to scroll, in the event that an item listed is longer than the width of the listbox.
I thought I had found it on this site once before, but I have tried searching for it with no luck.

MSChart ....Listbox......Scrollbar
Hi there ...
I'm stuck with a unique and not so unique problem.......
Actually tis is wat i'm doin...
1) Read a file (txt) where I keep my small records.upto 4000...since my prof allows that much only .
2) Seperate with strings n get the data into a Listbox.
3) Take the Data and plot a graph (40 columns only) ...this mschart control is aweful man...but u know wen u're stuck ..it's terible...my mind is saturated already
Well till now everything OK .....BUT the Problem starts Now .....

4) As new data comes in I shud be able ot show it on the Screen like scrolling ....every five minutes.......
5) There's a Horizontal Scrollbar attached too ...which when I scroll will scroll the Chart Horizontally ..................................

Please can anyone help??????
My submission data is coming else my semester..is ..........
Thanks a TONNNNNN

Horizonatl Scrollbar In Listbox
Hi,

How to add HScrollbar in List bao.. Is anyone can hel me. i have tried these code...got from internet. but its not working. am I missing somethinG?

Private Declare Function SendMessageByNum Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, ByVal _
wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Const LB_SETHORIZONTALEXTENT = &H194

Private Sub InitBillingMatrixCombos()

and then used these statement. tried befro add to list and also after add to list. but still not working.
Call SendMessageByNum(List1.hwnd, LB_SETHORIZONTALEXTENT, 800, 0)

List box always use the vertical scroll bar and all the items are displayed vertically...i really appreciate your help.

Thanks in advance..
Nitesha

Listbox Inventory Scrollbar
when a item is removed or replaced from a listbox the scrollbar jumps back to the top which is annoying, can i prevent this?

Listbox Scrollbar Coloring?
guys!

can the color of the scrollbar of the listbox be changed?????

Multiple Listbox Scrollbar
When I use a scrollbar in a listbox,
I want to move all scrollbar of all listbox in the same form.
I think it's possible with the method SCROLL
but I don't know how to code it.

Remove Scrollbar From Listbox
Hi guys,
Just a quick one. Is it possible to remove the scrollbar from a listbox? Coz' I've got 10 listbox here, and I just want the first listbox to have the scrollbar. The rest of the listboxes doesn't require the scrollbars, as the data can be controlled by the scrollbar of the first listbox.

Please help guys. This is very urgent. Thanks a lot.

Horizontal Scrollbar In Listbox
Hi,
i'm trying to put a horizontal scrollbar on my listbox, but i'm loading the info from one form to another, not on the same form, so it's not working properly. I've tried using this:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const LB_SETHORIZONTALEXTENT = &H194

Private Sub Form_Load()
SendMessage Form1.List1.hWnd, LB_SETHORIZONTALEXTENT, 240, 0
End Sub

Does anyone know what the problem is

Horizontal Scrollbar On Listbox?
Hi,
how can i set a listbox so it can scroll horizontally so the user can view the full line. Thanks.

Add Horizontal Scrollbar On Listbox In VB6.0
HI,

Does anyone know how to add horizontal scrollbar on Listbox in VB6.0? I couldn't get it from internet.

Regards,
XInXin

How To Get VB ListBox Horizontal Scrollbar
Hi all,

I wanted a listbox with horizontal scrollbar, is it possible with VB.


regards,
mcdee

 >>mcdeeiis
 >>Success is often just an Idea away.....

Vertical Scrollbar In Listbox
Hi
I am using vb6 - and using a standard list box which i am populating with about 30 items - I want a vertical scroll bar on the list box but it gives me a horizontal one - and in the properties of the list box there is not an option for vertical/horizontal scrolling
how can i get a vertical scroll bar in a list box in vb6 ? thanks

How To Determine And Set Scrollbar Pos In ListBox
I have a listbox with a horizontal scrollbar on an Access 97 form. I need to determine the current position of the scrollbar (how far it's been scrolled over) and later set it to a specific position. Is this possible? Thanks.

-JB

Anyone Know How To Add Scrollbar To Listbox In EVB? I Cannot Figure It Out!
All I need is how to call the coredll.dll which contains sendmessage routine.

Here's a nice snafu I ran into:
DONT try to use the Left Function in a form. Instead make a different
named function in a module and call it b/c it's a bug (recognized by MS)

Example of routine I use in my module:

Public Sub MSLeftErrorWorkaround(strString As String, intLength As Integer)
    gblLeftString = ""
    gblLeftString = Left(strString, intLength)
End Sub

Blocking The ListBox Scrollbar
I want to make my own scroll bar for a listbox, and disable the one they use when you get more items than can be displayed in the specified height. Is there a way i can replace the standard microsoft scrollbar with art of my own? Or can i just completely block it's scroll bar and code my own? Anyone got an idea how? Any help would be greatly appretiated. Thanx in advance - Atlantis

How Do I Give A Listbox A Verticle Scrollbar?
How do give a listbox a Verticle Scrollbar, insted of a horisantal one?

Move Scrollbar Back To Top Of Listbox
Is it possible to programmatically force the scrollbar on a listbox to go to the top of the list? By default, I guess, the scrollbar stays where it was last. However, during a certain event (a button push), I want the scrollbar to go back to the top. Thanks in advance!

How Might I Go About Creating A Custom Listbox And Scrollbar?
Hi all,

Quick question.....

I'm trying to create a listbox that doesnt use the standard scrollbar. The reason for this is i'm using an irregular form and it looks out of place to have the default scrollbar in my application, seeing as how everything else is a bitmap (controls). Ive seen this done in many games, where they have a chatbox that you can scroll (listbox) and it uses a scrollbar based on their bitmaps for the up arrow, down arrow and slider in between. I'm really not sure where to start here, but i'm assuming that I wouldn't be able to use your standard list box. Any suggestions?

Thanks in advance to any replies.

Subclass Listbox To Remove Scrollbar?
Hello, I'm working on a project right now that is basically cloning the Winamp 2.x series of players. I'm just doing it for a class, I have no intention of making it very public, but anyway, my question is, I need to get rid of the scrollbar in a list box so I can control it with my own custom scrollbar. If it's something that's too hard for an intermediate person then maybe I'll just work on making a custom listbox, but I really don't want to have to resort to that. I have limited API programming under my belt, and I basically know enough about subclasses to know what it is and how it works, but that's about it. Any help would be greatly appriciated.

How Do I Detect A Scrollbar Click In A Listbox
Hi team, how do I detect when a user slides or clicks on a list box's scrollbar?

Thanks

FW

Give Horizontal Scrollbar To Listbox
anyone knows this function? tks

Wordwrap In A Listbox Or Horizontal Scrollbar
How do you make a string in a listbox wrap around to the next line or make a horizontal scrollbar appear so that the rest of the string is visible? Thanks.

Listbox Resize?
before i post a topic on how to change the width of a listbox during runtime using this code?

listbox.width=x where x is width which you want for example:
listbox.width=2000 (here value is in twips)

twip - 1/20 of a printer's point. There are thus 1,440 Twips to an inch or about 567 Twips to a centimetre.


That code, was in a button.. But how about if resize the Listbox using a mouse?

Binding A Scrollbar Control To A Numer Of Listbox Controls
hi, i'm looking to scroll a numer of listboxes *without scrollbars* in a page using a seperate scrollbar control.

i'm guessing that i'll use a timer with

If list1.topindex <> list2.topindex then
list1.topindex = list2.topindex
end if

etc inside or osmething along those lines.

The way i have it set up is that the listboxes resize to fit however many items are added to them, and if necessary resize off the bottom of the frame they're contained in. I would like to be able to move them physically on the screen if possible to correspond to the position of the single scrollbar.

any ideas?

thanks in advance for any help

Dunc

Resize Listbox Column
I have a ListBox with 2 colums and I would like to increase the second column width. Is there any way to do that.

Thanks

Resize ListBox At Run Time
It seems I cannot enlarge a listbox at run time, only shrink it. If I try to increase the .Height property, it just ignores me.

Worse, if I change the font size at run time, the box shrinks vertically each time I enlarge the font, and it does not go back when I shrink the font. Before you know it, the listbox is a single line :-(

Here is my code:
I have a (+) button and a (-) button.


Code:
Private Sub cmdMinus_Click()
' make sure the box does not get too small
If ListBox1.Height > 1600 Then
ListBox1.Height = ListBox1.Height - 200
Else
ListBox1.Height = 1400
End If
End Sub ' cmdMinus_Click()

Private Sub cmdPlus_Click()
ListBox1.Height = ListBox1.Height + 200
End Sub ' cmdPlus_Click()
What's wrong with that?

Any help appreciated

Didier KO4BB

Resize Listbox For Combobox
I want to increse the width of the list box for a combo box but the width of the original combo box must not change. What need I do?

Is there any way to set a variable to the list box itself?

--
She works hard for the money so hard for it, honey
She works hard for the money so you better treat her right

Listbox Bottom Pogo On Resize!?
Hi Guys,

Using:
MDI Form (frmMain)
child (frmKitList) with BorderStyle=0 with a listbox in a frame

Using:
Code:
  Private Sub MDIForm_Resize()
    On Error Resume Next
    'set KitList
    With frmKitList
        .Height = frmMain.ScaleHeight
    End With
  End Sub


to resize the child

Problem:
Whatever code I use to resize the child's controls makes the listbox's bottom jump up and down around 10 pixels whilst resizing, I am wondering if this is something to do with resolution as when maximized it is spot on in place.



help!

Cheers,

dp

ListBox (search, Horizontal Scrollbar, TabStops) &"SendMessage API&"
hey all,

Here's some example of adding some extra functionality to a listbox with a simple SendMessage API call and a few message constants.


enjoy

Regan

Treeview Scrollbar Color (or Custom Scrollbar)
i am wondering how (if it is possible) to change the color af the scroll bar from a treeview. i have a fully skinnable program and everything can be changed (background and text color of the treeview too) but those scroll bars are damn ugly with a black skin. Is there either a way to change the color or to create a custom scrollbar for the treeview?

When One Scrollbar Moves, The Other Scrollbar Should Move Simultaneously
Hi,

I have two textboxes, text1 and text2. They both have vertical scrollbars. The textboxes are the exact same width and height. I want these scrollbars to be linked: whenever the scrollbar of text1 is moved, it will automatically move the scroll bar of text2, and vice versa, to the exact same distance.

Any idea how I can do this?

Thanks for any help.

Linking My Customized Scrollbar To The Richtextbox Scrollbar?
OK, the richtextbox has no value command so the scroll bar cant be accessed by any other controls through code, i want to link a scrollbar that i have developed (and works on its own) to the richtextbox scrollbar...i know it sounds strange but i have a real good reason for needing to do this

So, can anyone help? how can i access and change the richtextbox scroll value? is it even possible?

Make A Listbox (or Whatever User Control) Automatically Resize When User Resizes Form
Is there any option, event, or whatever I can trigger to make a listbox (or whatever other user control) automatically enlarge when a user enlarges the form?

eg. the listbox is almost as big a the form (with small margins) and the form is of a specified size. Whe the user maximizes the form, the dimensions of that listbox don't change. How can I make them change automatically?


thx

Copyright © 2005-08 www.BigResource.com, All rights reserved