473,395 Members | 1,656 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,395 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 3157
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.