Couple of userform textbox/commanbutton questions

PATSYS

Well-known Member
Joined
Mar 12, 2006
Messages
1,750
Hi all,

I have textbox1 and commandbutton3 in userform.

Commandbutton3 has the below code:

Code:
Private Sub CommandButton3_Click()
x = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Choose File", MultiSelect:=False)
MsgBox "You selected " & x
End Sub
[code]


1. I would like that commandbutton3 to be only visible if the user selects textbox1

2. When user clicks on commandbutton3 and selects the file, I would like x to populate textbox1.


Is that possible?

Thanks
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
In the Object Browser there is a class fmDropButtonStyle that lists
fmDropButtonStyleArrow
fmDropButtonStyleEllipsis
fmDropButtonStylePlain
fmDropButtonStyleReduce

I got that bit thanks, but I can't find 'ShowDropButtonWhen'...
 
Upvote 0
From memory, but I think the constants for the ShowDropButtonWhen property are
fmShowDropButtonWhenFocus
fmShowDropButtonWhenAlways
fmShowDropButtonWhenNever

The Object Browser does not show that as a property for a Text Box in my version either.
 
Upvote 0
After some testing, the RefEdit control also has to these properties, even though they aren't listed in the Object Browser.
 
Upvote 0
From memory, but I think the constants for the ShowDropButtonWhen property are
fmShowDropButtonWhenFocus
fmShowDropButtonWhenAlways
fmShowDropButtonWhenNever

The Object Browser does not show that as a property for a Text Box in my version either.

It's not in my Object Browser anywhere. Any idea why that may be?
 
Upvote 0
In Excel 2004, the DropButtonStyle and ShowDropButtonWhen properties and associated constants are part of the MicroSoft Forms 2.0 Object Library.

When using 2007 at work, I seem to recall (un-tested) that the properties for a UF control aren't shown in the Object Browser unless the project has a UF with that kind of control.

You might try putting a ComboBox in a userform and entering DropButton as the Object Browser's search term.
 
Upvote 0

Forum statistics

Threads
1,216,126
Messages
6,129,008
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top