ListBox Showing Scroll if 1 item

I have a ListBox that I fill with data from my database.  I then set the 
number of rows attribute to the count so the box is only as large as the 
number of fields.

lbDisplay.Rows = lbDisplay.Items.Count;

This works fine.

The problem is if the list has 1 item, it shows a dropdown arrow and when 
you press it, it shows only the one item.

If there are 2 or more there is no dropdown arrow.

How can I get rid of the dropdown arrow for one entry???

Why does it even show?

Thanks,

Tom 


0
tshad
11/18/2009 10:18:28 PM
dotnet.framework.aspnet 1423 articles. 0 followers. Follow

3 Replies
929 Views

Similar Articles

[PageSpeed] 59

you can't, because it sets the of the number of visible options. 1 = 
dropdown, anything > 1 is a list. there is no 1 row list support in a 
browser.

-- bruce (sqlwork.com)

tshad wrote:
> I have a ListBox that I fill with data from my database.  I then set the 
> number of rows attribute to the count so the box is only as large as the 
> number of fields.
> 
> lbDisplay.Rows = lbDisplay.Items.Count;
> 
> This works fine.
> 
> The problem is if the list has 1 item, it shows a dropdown arrow and when 
> you press it, it shows only the one item.
> 
> If there are 2 or more there is no dropdown arrow.
> 
> How can I get rid of the dropdown arrow for one entry???
> 
> Why does it even show?
> 
> Thanks,
> 
> Tom 
> 
> 
0
bruce
11/19/2009 4:14:57 AM
"bruce barker" <nospam@nospam.com> wrote in message 
news:e$Tib7MaKHA.5348@TK2MSFTNGP06.phx.gbl...
> you can't, because it sets the of the number of visible options. 1 = 
> dropdown, anything > 1 is a list. there is no 1 row list support in a 
> browser.
>
> -- bruce (sqlwork.com)
>
> tshad wrote:
>> I have a ListBox that I fill with data from my database.  I then set the 
>> number of rows attribute to the count so the box is only as large as the 
>> number of fields.
>>
>> lbDisplay.Rows = lbDisplay.Items.Count;
>>
>> This works fine.
>>
>> The problem is if the list has 1 item, it shows a dropdown arrow and when 
>> you press it, it shows only the one item.
>>
>> If there are 2 or more there is no dropdown arrow.
>>
>> How can I get rid of the dropdown arrow for one entry???
>>
>> Why does it even show?
>>
>> Thanks,
>>
>> Tom 


0
tshad
11/19/2009 7:24:59 PM
"bruce barker" <nospam@nospam.com> wrote in message 
news:e$Tib7MaKHA.5348@TK2MSFTNGP06.phx.gbl...
> you can't, because it sets the of the number of visible options. 1 = 
> dropdown, anything > 1 is a list. there is no 1 row list support in a 
> browser.

That doesn't make much sense.

Why would they do that???

Thanks,

Tom

>
> -- bruce (sqlwork.com)
>
> tshad wrote:
>> I have a ListBox that I fill with data from my database.  I then set the 
>> number of rows attribute to the count so the box is only as large as the 
>> number of fields.
>>
>> lbDisplay.Rows = lbDisplay.Items.Count;
>>
>> This works fine.
>>
>> The problem is if the list has 1 item, it shows a dropdown arrow and when 
>> you press it, it shows only the one item.
>>
>> If there are 2 or more there is no dropdown arrow.
>>
>> How can I get rid of the dropdown arrow for one entry???
>>
>> Why does it even show?
>>
>> Thanks,
>>
>> Tom 


0
tshad
11/19/2009 7:25:31 PM
Reply:

Similar Artilces:

Discount all items in a department?
Is it possible to discount all the items in a department (or other specified group) in one go? E.g. I want to discount all our 'media' department by 10% Help. El Presidente, SO Manager --> Wizards menu --> Inventory Wizard --> Task 110 Change Item Price --> Press Next --> Choose the Department --> Press Next, this is where we need to figure out if you are doing a permanent mark down or a sale for a specific period of time. For a Permanent Mark Down: Price change method = Discount from Regular price Percentage = 10% Price to be changed = Regular Sale for a spe...

The Sum from 1 worksheet cell to another worksheet cell
the sum from one cell on sheet1 from another cell on sheet2,how do you do the formula qwerty: To sum the value on Sheet1, cell A10 with the cell value Sheet2, cell B20, enter =Sheet1!A10 + Sheet2!B20 (or you can enter '=' sign and click on A10, then enter the plus sign and click on B20) jeff >-----Original Message----- >the sum from one cell on sheet1 from another cell on sheet2,how do you do the formula >. > ...

Show a date 30 days out
I have a feild that I would like to show what the date would be in 30 days for a feild with a date in it [Sold Date]. Sold Date feild would be 1 Jan 07 so the feild would show 30 Days later 31 Jan 07. I did =[Sold date]+30 and it did not work Thanks how about dateadd: dateadd("d", 30, [Sold Date]) -- steve. "KAnoe" <KAnoe@discussions.microsoft.com> wrote in message news:DE9BDDAE-5C84-4A52-8185-DAB6C3167E7A@microsoft.com... >I have a feild that I would like to show what the date would be in 30 days > for a feild with a date in it [Sold Date]. > ...

Creating a print-macro that'll only print page 1?
Hi, I have a spreadsheet that contains multiple sheets. I want to add a button that runs a macro, which only prints page 1 on the first sheet (called Scorekort). The "Scorekort" sheet contains 13 pages in total, but I only want to print the first page. Any ideas for this macro? Anders hi, Sub Macro1() Sheets("Scorekort").PrintOut From:=1, To:=1, Copies:=1, Preview:=True, Collate:=True End Sub if you don't want a print preview, Preview:=False -- isabelle Le 2011-05-21 04:16, Anders M a �crit : > Hi, > > I have a spreadsheet that contains multiple ...

1 Chart
I presently have an XY line chart showing asset price over time. Pretty simple. X Axis - Time Scale Y Axis - Asset Price I would now like to add an additoinal series showing the volume of assets traded, ideally this would be as a bar chart sitting "underneath" the asset price on the chart. They would share the same X Axis. I have added another series, but this simply displays the volume traded as another line, and even when this is set to a secondary axis the scaling makes this unworkable. i have adjusted the scales of both, still this does not make it workable, i want the series...

Enter "1", cell show ".01". Why?
Any number typed into a cell is divided by 100. If proceded by "=" the number is correct. What caused this and how can I fix it? Try this .. Click Tools > Options > Edit tab Uncheck "Fixed decimal" > OK Things should be back to normal now .. (it's a fixed decimal setting !) -- Rgds Max xl 97 --- Singapore, GMT+8 xdemechanik http://savefile.com/projects/236895 -- "Yonian" <Yonian@discussions.microsoft.com> wrote in message news:40499CA4-7FAF-42A6-8B19-A90881735C50@microsoft.com... > Any number typed into a cell is divided by 100. > If p...

Text Effects Scrolling or Blinking text
How do apply the scroll or blinking feature to text that you want to emphasize in a word document. Prior to MS2007 there was a feature on the fonts tab that allowed a user to apply the following features to text "marching ants, blinking text, scrolling marquee, etc. I cannot find the any of these features anywhere in Word 2007. "HELP" There is no direct access to them, but they are still available by macro I posted the following macro recently, for use in Word 2007 Sub AnimateFont() Dim sAnimation As String If Len(Selection.Range) = 0 Then MsgBox "...

Delivery Options Does Not Show Up.
I need to setup an alternative recipient to one of my mailboxes but I can't seem to find the Delivery Options Button under "Exchange Advanced" tab of ADU&C. I can only see three options: Custom Attributes ILS Settings Mailbox Rights What am I missing. It should be there. Thanks for your time Percy it's on the Exchange General tab... -- Susan Conkey [MVP] "Percy" <Percy@discussions.microsoft.com> wrote in message news:845C7BCF-BB5B-4E56-9CB6-5C05F32F3A9E@microsoft.com... >I need to setup an alternative recipient to one of my mailboxes but ...

Integrating Great Plains 8.0 and CRM 1.2 and Windows Small Busines
Integrating Great Plains 8.0 and CRM 1.2 I run a Windows Small Business Server 2003 Premium box along with a Windows Server 2003 Standard box used for my Great Plains 8.0 and SQL 2000. I’m considering introducing CRM 1.2 Professional into the mix. From a hardware stand point I know I’m fine all around. I’ve been researching how I should configure CRM and am a bit confused. The info I’ve found in KB887153 states “When you install Microsoft Business Solutions CRM Integrations for Great Plains 7.0, 7.5, or 8.0, Microsoft BizTalk Server is also installed. However, BizTalk Server 2000 and B...

Dates in fomula showing as whole number
I have a fomula in a cell that takes the name of a person (from cell 2B), their License number (from another cell 2C)and the Date that License Expires (From cell 2D). The expire date in "2D" is either the word "none" or a date that that persons license needs to be renewed. Those instructors with "None" come out in the calculated field fine, however the ones with dates come back as whole numbers, Example 8/6/10 shows 40396. any help will be appreciated Hi, You need to change the format of that cell or column, highlight the cell or the column, right click o...

SK 40175 Tuff-1 1/2-Inch Drive 15-Inch Reversible Ratchet
Price:$90.24 Image: http://thediscounfinder.info/image.php?id=B0009U5RRM Best deal: http://thediscounfinder.info/index.php?id=B0009U5RRM Item #: SKT40175. Features & Benefits:Tuff 1(r) Ratchets 72 tooth head design delivers a short 5" stroke for use in tight areas.17 teeth engage when torque is applied to provide a strong grip without slippage.Thumb falls naturally into position, giving instant control with one hand.Easy to reverse, 4 point cap.SuperKrome plating for long tool life and maximum corrosion resistance.Description: 15" Reversible Tuff Customers also search for:...

Scroll horizontaly with mouse, create same system used to scroll .
Hi, I think it would be great if mouses adopted a second scroll button, for horizontal scrolling, just like the vertical one .... Indeed, when you work with wide Excel spreadsheets, you can easily scroll down but to scroll from left to right or vice-versa, you have to use the scroll bar or arrows and it's annoying... So, am I a millionnaire yet??? Hi Frederic, > I think it would be great if mouses adopted a second scroll button, for > horizontal scrolling, just like the vertical one .... Indeed, when you work > with wide Excel spreadsheets, you can easily scroll down b...

Copy Matrix Items
I am afraid I know the answer to this already but here goes- I have a prospective shoe store customer who receives as many as 500 pairs of shoes in a lot. Most of the time 50% or more of these shoes have not been stocked before and they don't know what the shoes will be until they get the lot. Because of the nature of shoes they need the ability to quickly enter in the assorted sizes and colors in a run of Men's, Women's, Children's etc. While the New Item Wizard for a Matrix Item works well the customer would like to not have to enter in the size runs each time since they a...

MemDC & Scroll Control with Mouse Wheel
Ever since I changed to use MemDC, using the mouse wheel made my CSrollView a complete mess. The wheel mouse control was working fine with my flickering version. Then I used MemDC to get rid of flickering issue, now I am having this scrolling issue for using the middle wheel mouse button. What could be wrong? Thanks. On 12 Aug 2005 06:53:36 -0700, guxu@hotmail.com wrote: >Ever since I changed to use MemDC, using the mouse wheel made my >CSrollView a complete mess. The wheel mouse control was working fine >with my flickering version. Then I used MemDC to get rid of flickering &g...

Can I show server name instead of drive letter?
When using the =Cell("filename") function, I would like to show the actual server instead of a drive letter because the letter is dependent on where the server is mapped and not all users have the same mapping. Is this possible? Try using: \\ServerName\drive\... where ServerName is the name of the server and drive is the appropriate drive, and then find the file on the drive from that point. "bfant" wrote: > When using the =Cell("filename") function, I would like to show the actual > server instead of a drive letter because the letter is dependent on...

"Can't copy the items. You don't have permission ..."
I use OL 2003, latest service pack,etc. My PST file is about 1.2 GB and is Unicode-compatible. Lately Outlook shuts down suddenly without warning, and I have left checked the box to restart Outlook automatically. This is a big annoyance. However, in the last 2-3 days, I'm seeing a new kind of problem. I can't delete or move messages from mail folders. I get the message that is in the subject line, and the balance of this message is: ... to create an entry in this folder. Right-click the folder and then click Properties to check your permissions for the folder. See the folder o...

Highlight color for selected items
How can I find out what color is used for highlighting selected items (for example in Windows Explorer)on a users computer? Normally it is a blue color, but a user can change that. "Urban Olars" <anonymous@discussions.microsoft.com> wrote in message news:071c01c3c941$3db2c890$a401280a@phx.gbl... > How can I find out what color is used for highlighting > selected items (for example in Windows Explorer)on a users > computer? > Normally it is a blue color, but a user can change that. See if it's GetSysColor/COLOR_HIGHLIGHT. -- Jeff Partch [VC++ MVP] Take a ...

Need Help With GP Item Pricing
GP ITEM PRICING I need to use “Bucket Pricing” for items in GP. For example below is the pricing schedule that I need to use. First 20 …………….$ 1.75 Next 280 ……………… 1.36 Next 700 ……………… 1.23 Next 2,000 ……………… 1.09 Over 3,000 ……………… .82 So if I had a Qty. of 350 it would be as follows 20 * 1.75 = 35 280 * 1.36 = 380.80 50 * 1.23 = 61.50 Total : $477.30 In GP I can only set it up to do a “Quantity Range” in the Item Price List Maintenance window. Problem is if I set it up that way and enter a quantity of 350 it will default to the $1.23 ...

deleted items #7
Does anyone know what and how I can view and/or delete the 1129 items my Outlook says I have in my deleted items folder. 1 says unread. Thanks If can see the Deleted Items folder in the folder list, right-clicking on it reveals "Empty Deleted Items folder" If you can't see the folder list, it's under the 'Go' menu in Outlook 2003, and under the 'View' menu in earlier versions You can also empty the Deleted Items folder automatically every time you close Outlook. Tools menu > Options > 'Other' tab. Choose the 'Empty the Deleted Items f...

Converting from Lotus 1, 2, 3 docs
I have a user who has a bunch of Lotus 1, 2, 3 spreadsheets that he is trying to convert to Excel. His version of Lotus is old (version 5), his version of Excel is 2000 sp2. The files convert but they are missing pages or headings or other unacceptable qualities. Anyone any advice? Michael If you open the files using Excel and save them to an .xls format in the current version you are losing data? A while back I needed to do this. I wrote an application in VB that loops through the files, opens them using Excel (add a reference in VB to MS Office 10) and then save them in the current ...

invisible listbox data
I have developed software in Acces XP that is distributed to two different locations and I have noticed some odd behaviour at one of the locations. Sometimes the data in listboxes or combo boxes is invisible. The data IS PRESENT because you can select and use the records as before (although you can't see which ones you're selecting). The combo boxes are poplulated and have the correct dropdown length for the records one would expect. The listboxes have scroll bars where one would expect a scrollbar and multiselcetion is possible where apropriate. I have played around with th...

Scrolling in Address Book
Help Please. I am unable to use my scroll wheel in the Address Book of Outlook 2002 (SP 3 Installed). It works throughout the rest of the program, such as scrolling through messages, etc. Also, moving the sliding bar on the right of the screen does not move the entries either. This is a major inconvenience for me. ...

Show picture outline only when moving in PowerPoint
It's probably simple when you know it, but I'm sure there's a setting that I can toggle, so when I move a large picture in PowerPoint, only the outline shows, not the whole picture. This is because the pictures I'm inserting need to be of good quality, and my laptop struggles with them when I move them. ...

Permissions after 12.1.2 update
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Question. Not sure, but I after running the 12.1.2 office 2008 updater, I noticed this when repairing permissions using disk utility Permissions differ on "Library", should be drwxrwxr-t , they are drwxrwxr-x . Now, I also noticed other disk utility repair permissions that take place after the weekly overnight sripts run. I am just trying to figure out if running the office 2008 updater 12.1.2 could generate the permissions fix reported above. I installed this on 2 exactly the same computers, and didn't g...

Non AD emails going to 1 user
I have an Exchange 2003 server running on SBS 2003 the issues is one user is getting all the emails sent to him that look like they are coming from his domain. For example his email is user@mydomain.com but in his inbox he is getting XYZ@mydomain.com but XYZ is not in the AD or has a email box set up on this server. Why is getting this non AD email and how can I stop it. Thanks in advance Are you sure it's not a SPAM where the spammer may have simply put in 123abc@mydomain.com and BCC it to all possible conceivable names @mydomain.com?? R Green "LaOVis" <LaOVis@discuss...