473,661 Members | 2,465 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Add horizontal Scroll bar to a Server Control Listbox or DropDownL

Hi Everyone,

How come Server listbox control does not have a Horizontal Scroll Property?
If any one has an idea how we add a Horizontal scroll to a listbox or
dropdown list box it would be quite helpful.Thanks in advance

Regards
Vidds

Nov 23 '05 #1
3 2515
Vidds wrote:
Hi Everyone,

How come Server listbox control does not have a Horizontal Scroll Property?
If any one has an idea how we add a Horizontal scroll to a listbox or
dropdown list box it would be quite helpful.Thanks in advance

Regards
Vidds


It's more than likely because the HTML SELECT control does not have that
capability (which is what ListBox renders to).

If you really, really need it, one idea would be to create a custom
ListBox class whose HTML looks like this: sets the width of the SELECT
to that of your widest value's width (the max width of the scrollbar,
for example). Now wrap that SELECT inside of a DIV of the 'constrained'
size and let it scroll on overflow.

--
craig
Microsoft MVP - ASP/ASP.NET
Nov 23 '05 #2
Thanks for the reply Craig .But if you can elaborate more on the solution it
would be great.

Regards
Vidds

"Craig Deelsnyder" wrote:
Vidds wrote:
Hi Everyone,

How come Server listbox control does not have a Horizontal Scroll Property?
If any one has an idea how we add a Horizontal scroll to a listbox or
dropdown list box it would be quite helpful.Thanks in advance

Regards
Vidds


It's more than likely because the HTML SELECT control does not have that
capability (which is what ListBox renders to).

If you really, really need it, one idea would be to create a custom
ListBox class whose HTML looks like this: sets the width of the SELECT
to that of your widest value's width (the max width of the scrollbar,
for example). Now wrap that SELECT inside of a DIV of the 'constrained'
size and let it scroll on overflow.

--
craig
Microsoft MVP - ASP/ASP.NET

Nov 23 '05 #3
Vidds wrote:
Thanks for the reply Craig .But if you can elaborate more on the solution it
would be great.

Regards
Vidds


Here's a quick example starting down those lines, here's the type of
HTML you want spit out by a control:

<div style="width:20 0px; height:100px; overflow:auto;" >
<SELECT size="4">
<OPTION
Value="1">blahb lahblahblahblah blahblahblahbla hblahblahblah</OPTION>
<OPTION Value="2">2</OPTION>
<OPTION Value="3">3</OPTION>
<OPTION Value="4">4</OPTION>
</SELECT>
</div>

so in essence I'd recommend creating a composite custom control for
this, which renders this HTML. They're pretty easy to make, Google on
the terms 'composite control asp.net'.

The toughest part will be matching up the div dimensions to that of the
select box, to make the scrollbars work/line up properly. That's why
it's kinda tricky.

--
craig
Microsoft MVP - ASP/ASP.NET
Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1213
by: Max | last post by:
How do you get the Horizontal Scroll Bar to appear in a listbox with drawmode set to OwnerDrawVariable? Like I have HorizontalScrollBar property set to true but when the text in the listbox entry is long the scroll bar does not appear. Any ideas how to do that? Cheers, Max
1
2452
by: prathima | last post by:
I have a problem in the ListBox - Webcontrol(ASP.NET). If the length of the string exceeds the width of the ListBox, I am unable to view the full string, since the horizontal scroll bar does not exist. How do we include a horizontal scroll bar for a list box in a web control? Thanks in advance... Prathima
2
2358
by: Lloyd Sheen | last post by:
I have searched wide and far through google for a solution to no avail. Is there a method available to add a horizontal scroll bar to a listbox in asp.net. Thanks in advance
2
4454
by: Tina | last post by:
Am I missing something or does the listbox web control not have a horizontal scroll capability? Thanks, T
4
1986
by: André Nobre | last post by:
hi all... i have a listbox in a webform and i wanna know if there´s way to put horizontal scroll in it. I tried HorizontalScrollbar = True, like windows forms but it didn´t work. Anyone can help me? Thanks, André
7
5103
by: J-T | last post by:
My website is fine when it is viewed in 1280 by 1024 pixel ,but in smaller resulotions there is a horizontal scrollbar down the page.How can I set it to be viewed the same for all resulotions? Thanks
7
9370
by: Pachydermitis | last post by:
Hi all you Experts, I need to scroll a listbox horizontally. For the life of me I cannot get it to move. I can successfully scroll it vertically. I have the handle for the listbox and the scroll bar. I have even tried sending it vbKeyRight to no avail, but it doesn't register the key strokes. I am using lDirection = WM_HSCROLL
1
1651
by: Mae Lim | last post by:
Hi all, I have a question, how can I add an horizontal scrollbar to a listbox control? I have tried "overflow:scroll;" using <divbut the scrollbar will be display outside of the listbox. I want the scollbar within the ListBoxControl, how can that be done? Please help, thanks in advance.
5
1478
by: KUTTAN | last post by:
I have a ListBox I want to show it with 300px width.(increasing the with will lead to bad look of the page , in my case) But unfortunately the some data loaded to this ListBox is string having lenght more than 300px So user cant read it full , the right side are not seeing I can solve this by adding a horizontal scroll to the ListBox
0
8341
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8754
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8542
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7362
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2760
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.