473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

combo box width - (how do you change it)

Hello all,
Could anybody tell me how to change the drop down width of the drop down control for VB.NET!!!

There are loads of examples for vb 6 ie
http://vbnet.mvps.org/index.html?cod...rightalign.htm

But VB.NET doesn't allow the use of the ANY keyword in the declare statements.

Any help with this would be super.

Thanks in advance.
Phil.

Nov 22 '05 #1
5 3158
Hi,

Try this:

At the class level,
Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, _
ByVal Msg As Integer, ByVal wParam As Short, _
ByVal lParam As Short) As IntPtr

In the form load event,
' &H160 - CB_SETDROPPEDWIDTH
' 400 - Desired drop-down width
SendMessage(ComboBox1.Handle, &H160, 400, 0)

HTH.

"Phil" <Ph**@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Hello all,
Could anybody tell me how to change the drop down width of the drop down
control for VB.NET!!!

There are loads of examples for vb 6 ie
http://vbnet.mvps.org/index.html?cod...rightalign.htm

But VB.NET doesn't allow the use of the ANY keyword in the declare
statements.

Any help with this would be super.

Thanks in advance.
Phil.
Nov 22 '05 #2
Trick Question right?
Set the DropDownWidth property.

For dotnet PInvoke signatures use www.pinvoke.net

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Phil" <Ph**@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Hello all,
Could anybody tell me how to change the drop down width of the drop down control for VB.NET!!!
There are loads of examples for vb 6 ie
http://vbnet.mvps.org/index.html?cod...rightalign.htm

But VB.NET doesn't allow the use of the ANY keyword in the declare statements.
Any help with this would be super.

Thanks in advance.
Phil.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004
Nov 22 '05 #3
Thanks Shiva,

Now you make me feel guilty.
I see that works for a VB.NET Windows Application, but I forgot to say that I am writing an ASP.NET web application.

Sorry for missleading you. Do you by anychance know how to do this in ASP.NET?
My problem with the code you gave me is that the ComboBox1 does not have the .handle property.
"Shiva" wrote:
Hi,

Try this:

At the class level,
Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, _
ByVal Msg As Integer, ByVal wParam As Short, _
ByVal lParam As Short) As IntPtr

In the form load event,
' &H160 - CB_SETDROPPEDWIDTH
' 400 - Desired drop-down width
SendMessage(ComboBox1.Handle, &H160, 400, 0)

HTH.

"Phil" <Ph**@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Hello all,
Could anybody tell me how to change the drop down width of the drop down
control for VB.NET!!!

There are loads of examples for vb 6 ie
http://vbnet.mvps.org/index.html?cod...rightalign.htm

But VB.NET doesn't allow the use of the ANY keyword in the declare
statements.

Any help with this would be super.

Thanks in advance.
Phil.

Nov 22 '05 #4
Sorry but no.

That would set the width of the DropDown box, but what I am tring to do is set the width of the actual drop down list not the field itself.

I admit my question did not specifically mention this. :-)

Phil

"Mick Doherty" wrote:
Trick Question right?
Set the DropDownWidth property.

For dotnet PInvoke signatures use www.pinvoke.net

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Phil" <Ph**@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Hello all,
Could anybody tell me how to change the drop down width of the drop down

control for VB.NET!!!

There are loads of examples for vb 6 ie
http://vbnet.mvps.org/index.html?cod...rightalign.htm

But VB.NET doesn't allow the use of the ANY keyword in the declare

statements.

Any help with this would be super.

Thanks in advance.
Phil.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004

Nov 22 '05 #5
Hi,

To my knowledge, drop-down width cannot be changed in ASP.NET; I don't think
we have any control over that.

"Phil" <Ph**@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
Thanks Shiva,

Now you make me feel guilty.
I see that works for a VB.NET Windows Application, but I forgot to say that
I am writing an ASP.NET web application.

Sorry for missleading you. Do you by anychance know how to do this in
ASP.NET?
My problem with the code you gave me is that the ComboBox1 does not have the
..handle property.
"Shiva" wrote:
Hi,

Try this:

At the class level,
Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, _ ByVal Msg As Integer, ByVal wParam As Short, _
ByVal lParam As Short) As IntPtr

In the form load event,
' &H160 - CB_SETDROPPEDWIDTH
' 400 - Desired drop-down width
SendMessage(ComboBox1.Handle, &H160, 400, 0)

HTH.

"Phil" <Ph**@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Hello all,
Could anybody tell me how to change the drop down width of the drop down
control for VB.NET!!!

There are loads of examples for vb 6 ie
http://vbnet.mvps.org/index.html?cod...rightalign.htm

But VB.NET doesn't allow the use of the ANY keyword in the declare
statements.

Any help with this would be super.

Thanks in advance.
Phil.

Nov 22 '05 #6

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

Similar topics

3
by: Diane Yocom | last post by:
Has anybody ever seen or written code for ASP that would mimic Access' multi-column combo box? Specifically, I have a drop down box that lists about 100 five-digit codes. Each of these codes has...
4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
5
by: Dalan | last post by:
I have been searching the archives in an effort to discover how to derive a dual use of a single combo box - so far no go. I found the piece below which pretty much represents the usage. To...
10
by: Bob Darlington | last post by:
I am using the following SQL as a RowSource for a combo box on a form. "SELECT LAN, TenantName as , ShopNum as FROM qTenantSelect " The field 'ShopNum' is a text field and has a caption...
8
by: Jack | last post by:
Hi, I have a asp page where multiple rows for a client is generated using asp. Some of these are combo boxes and some are text and are coming from a recordset. Now, the following is the code to...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
30
ADezii
by: ADezii | last post by:
This week’s Tip of the Week will clearly demonstrate how you can dynamically set the Drop Down List Width of a Combo Box to the length of the longest item in its Row Source. The inspiration for this...
4
by: Karl | last post by:
Using A2000 with 2 tables Table 1 is a reference table with 2 fields Table 2 has 2 fields and 2 combo boxes to lookup date in table 1 Combo1 binds to col 1 in table 1, this works OK Combo 2...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.