PC Review


Reply
Thread Tools Rate Thread

combo box width - (how do you change it)

 
 
=?Utf-8?B?UGhpbA==?=
Guest
Posts: n/a
 
      20th Jul 2004
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.

 
Reply With Quote
 
 
 
 
Shiva
Guest
Posts: n/a
 
      20th Jul 2004
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" <(E-Mail Removed)> wrote in message
newsB52AFBB-FEBB-48E9-A481-(E-Mail Removed)...
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.


 
Reply With Quote
 
Mick Doherty
Guest
Posts: n/a
 
      20th Jul 2004
Trick Question right?
Set the DropDownWidth property.

For dotnet PInvoke signatures use www.pinvoke.net

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


"Phil" <(E-Mail Removed)> wrote in message
newsB52AFBB-FEBB-48E9-A481-(E-Mail Removed)...
> 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


 
Reply With Quote
 
=?Utf-8?B?UGhpbA==?=
Guest
Posts: n/a
 
      21st Jul 2004
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" <(E-Mail Removed)> wrote in message
> newsB52AFBB-FEBB-48E9-A481-(E-Mail Removed)...
> 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.
>
>
>

 
Reply With Quote
 
=?Utf-8?B?UGhpbA==?=
Guest
Posts: n/a
 
      21st Jul 2004
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" <(E-Mail Removed)> wrote in message
> newsB52AFBB-FEBB-48E9-A481-(E-Mail Removed)...
> > 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
>
>
>

 
Reply With Quote
 
Shiva
Guest
Posts: n/a
 
      21st Jul 2004
Hi,

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

"Phil" <(E-Mail Removed)> wrote in message
news:6D0A670C-3097-4003-B7E0-(E-Mail Removed)...
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" <(E-Mail Removed)> wrote in message
> newsB52AFBB-FEBB-48E9-A481-(E-Mail Removed)...
> 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.
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Cell Width WITHOUT changing Column width dww701 Microsoft Excel Misc 1 12th Jan 2009 10:52 PM
Change table width when changing width of a column Tom Doster Microsoft Powerpoint 0 9th Jan 2009 03:52 PM
word 2007--change copy from 1/2 of width of page to full width of page? aaronep@pacbell.net Microsoft Word New Users 4 12th Feb 2007 02:07 PM
Resize Iframe width on change of gridview width gary.comstock@gmail.com Microsoft ASP .NET 1 9th Jan 2007 08:40 PM
Resize Iframe width on change of gridview width gary.comstock@gmail.com Microsoft ASP .NET 0 9th Jan 2007 07:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:52 PM.