ScrollBar Width... (1 Viewer)

mfaisal.ce

Member
Local time
Today, 06:41
Joined
Dec 21, 2020
Messages
75
Hello Freinds,

1. I want to change scroll bar width in subform view.... plz tell me how can i do that?

2. Combobox dropdown, only show when i click on it else it shows as text box... how can i do that?

regards,
 

isladogs

CID VIP
Local time
Today, 04:41
Joined
Jan 14, 2017
Messages
14,842
1. AFAIK you can't. You can switch it off but the width is fixed at 255 Twips where 1cm = 568 twips

2. Use the dropdown property in code: Me.Comboname.Dropdown
 

mfaisal.ce

Member
Local time
Today, 06:41
Joined
Dec 21, 2020
Messages
75
1. AFAIK you can't. You can switch it off but the width is fixed at 255 Twips where 1cm = 568 twips

2. Use the dropdown property in code: Me.Comboname.Dropdown
1. It means that there is no way to decrease the width of scrollbar....
2.u didn't get mypoint about combobox.... I have a bound combobox but i need to look it as a textbox but when i click on it, it gives me dropdown option to select value.....
 

CJ_London

Super Moderator
Staff member
Local time
Today, 04:41
Joined
Feb 19, 2013
Messages
13,004
I have a bound combobox but i need to look it as a textbox but when i click on it, it gives me dropdown option to select value.....

so are you saying you don't want to see the down arrow on a combo box, and you want the dropdown to appear without a scrollbar when the user clicks on the control?

perhaps attach some images to illustrate what you are trying to achieve. You can always construct your own 'combo' using a combination of textbox and listbox or subform
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 04:41
Joined
Sep 12, 2006
Messages
14,485
I have a bound combobox but i need to look it as a textbox but when i click on it, it gives me dropdown option to select value.....

It may be that you haven't set the combo box properties correctly, and it's not quite showing the data in the way you want to see. It's quite a strange request - so is it connected with the way the the combobox displays the contents?
 

mfaisal.ce

Member
Local time
Today, 06:41
Joined
Dec 21, 2020
Messages
75
Yes bro u r right.... How it can be possible
so are you saying you don't want to see the down arrow on a combo box, and you want the dropdown to appear without a scrollbar when the user clicks on the control?

perhaps attach some images to illustrate what you are trying to achieve. You can always construct your own 'combo' using a combination of textbo
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 22:41
Joined
Feb 28, 2001
Messages
20,008
1. The problem with scroll bar width is that it is a registry element.


The fourth post in the referenced thread describes the process. NOTE, however, that (a) it would be system-wide (all or nothing at all) and (b) will require a reboot any time you want to change it. I cannot guarantee you that it would "stick" with the width you select either. Patching or a Windows Repair might easily reset it.

2. If it is a combo box, it is going to have a "down-arrow" element. That is the nature of the combo box. I searched for ways to control the visible features of the combo box but after a few minutes of searching several potential key phrases, ... no joy. That down-arrow is there to stay. AND if you try to control it by changing the width of the combo box, the arrow stays visible but the data display area shrinks. In theory, if you were REALLY good as a programmer and could get some guidelines from the C++ crowd, you could build your own control - but I'll bet its events wouldn't be quite right.
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 23:41
Joined
May 21, 2018
Messages
5,037
See demo on how to do what you want. This cannot be done on a continuous form without a lot more code.
 

Attachments

  • DemoDropDown.accdb
    456 KB · Views: 40

mfaisal.ce

Member
Local time
Today, 06:41
Joined
Dec 21, 2020
Messages
75
so are you saying you don't want to see the down arrow on a combo box, and you want the dropdown to appear without a scrollbar when the user clicks on the control?

perhaps attach some images to illustrate what you are trying to achieve. You can always construct your own 'combo' using a combination of textbox and listbox or subform
Plz see the attached image for reference....

I need scrollbar width to be reduced...

i need combobox dropdown menu to be shown only on focus, else hide it....
 

Attachments

  • Image.jpg
    Image.jpg
    84.3 KB · Views: 47

isladogs

CID VIP
Local time
Today, 04:41
Joined
Jan 14, 2017
Messages
14,842
As already stated you can't reduce the scrollbar width. That's a non starter.

Nor can you hide the combo drop down arrow.
However, you could overlay the combo with a textbox of the same width. When you click on the textbox, use code to set focus on the combo underneath then hide the textbox.
Or...forget about this and just use a smaller or narrower font to fit more in the space available
Or..use the alternative suggested by MajP with a textbox and a listbox underneath that only appears when the textbox is clicked
 

mfaisal.ce

Member
Local time
Today, 06:41
Joined
Dec 21, 2020
Messages
75
As already stated you can't reduce the scrollbar width. That's a non starter.

Nor can you hide the combo drop down arrow.
However, you could overlay the combo with a textbox of the same width. When you click on the textbox, use code to set focus on the combo underneath then hide the textbox.
Or...forget about this and just use a smaller or narrower font to fit more in the space available
Or..use the alternative suggested by MajP with a textbox and a listbox underneath that only appears when the textbox is clicked
thanks all dear.....
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 23:41
Joined
May 21, 2018
Messages
5,037
i need combobox dropdown menu to be shown only on focus, else hide it.
That is much easier to do. You were not very clear in the beginning
dropdown2.jpg

I have this on the keydown, but you can do this on the focus event instead. Here is all the code you need
Code:
Private Sub txtColor_KeyDown(KeyCode As Integer, Shift As Integer)
  Me.cmboColor.SetFocus
  Me.cmboColor.Dropdown
End Sub

FYI,
This trick of hiding a bound combo behind a bound textbox is the same way you do cascading combos on a continuous form. Also I forgot to set the tabstop on the combo to "No". You should do that if tabbing.
 

Attachments

  • DemoDropDown.accdb
    652 KB · Views: 35
Last edited:

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 04:41
Joined
Sep 12, 2006
Messages
14,485
I don't mean to be awkward, but I assume you are new to using Access, based on your post count. If so, I think you will have your hands full getting to grips with database development, rather than worrying about a tiny detail that I assume has never bothered anyone.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 04:41
Joined
Sep 12, 2006
Messages
14,485
In the example you posted the drop down width is the same width as on the form. I don't know if that was by intention or not. The drop down display width on the form doesn't have to be as be wide as the drop down expansion, (and the expansion can have more columns of information), so you could just make your display narrower, and save some space that way. Unless you have some long options in the list, it seems much wider than it needs to be. A user can also press shift-F2 to zoom the visible value of the combo box (or any control, come to that) , so there's other ways to reduce the width of the combo box. You could even code this zoom/expand behaviour into the combo box double click event (for instance).

One problem with changing the appearance of a combo box is that experienced users might not expect combo box behaviour from a control that doesn't look like a combo box, and may assume it's just a free text field as a result.

You may not have realised there were alternatives. The expand arrow is about 2 or 3 characters width at most. It hardly seems worthwhile spending a load of time on this, but it's your baby, and there's a few alternatives above.
 

isladogs

CID VIP
Local time
Today, 04:41
Joined
Jan 14, 2017
Messages
14,842
2 more things that haven't been mentioned so far AFAIK
You could also remove the record selectors on the left as they are taking up space.
And of course you could also increase the form width

But frankly I also think this isn't important enough to spend much time dealing with alternative approaches
 

jumnhy

Member
Local time
Yesterday, 23:41
Joined
Feb 25, 2021
Messages
68
FYI,
This trick of hiding a bound combo behind a bound textbox is the same way you do cascading combos on a continuous form. Also I forgot to set the tabstop on the combo to "No". You should do that if tabbing.
Hey @MajP, this is my curiosity and not a specific issue, so I didn't want to make a new thread--but can you elaborate on this "cascading combos" concept? If you have a demo database I'd love to take a peek.
 

isladogs

CID VIP
Local time
Today, 04:41
Joined
Jan 14, 2017
Messages
14,842
Hey @MajP, this is my curiosity and not a specific issue, so I didn't want to make a new thread--but can you elaborate on this "cascading combos" concept? If you have a demo database I'd love to take a peek.
PMFJI.
I have an example database with 5 cascading combo boxes where the info shown in each depends on what is selected in the previous combo.
Cascading Combo Boxes - Mendip Data Systems
 

Users who are viewing this thread

Top Bottom