Help! textbox height can't even be manually changed!!!!

mortgageman

Well-known Member
Joined
Jun 30, 2005
Messages
2,015
I have tried everything to get my textbox1 to be a certain height. As you can see, I even just plugged in a big number (1600) just to see what would happen. NOTHING HAPPENS. The size of the box doesn't change no matter what I do.

Is there something really stupid on my part going on?

Gene Klein



Code:
 .TextBox1.Top = 30
         .TextBox2.Top = 30
         MsgBox .TextBox30.Top
         MsgBox .TextBox1.Top
         MsgBox .TextBox30.Height
         '.TextBox1.Height = .TextBox30.Top - .TextBox1.Top + .TextBox30.Height
         .TextBox1.Height = TextBox30.Top + TextBox30.Height
          MsgBox TextBox1.Height
        TextBox1.Height = 1600
      
        .TextBox2.Height = TextBox1.Height
        .TextBox14.Height = TextBox1.Height
   
        .TextBox4.Visible = False
        .TextBox5.Visible = False
        .TextBox6.Visible = False
        .TextBox7.Visible = False
        .TextBox9.Visible = False
        .TextBox11.Visible = False
        .TextBox12.Visible = False
        .TextBox15.Visible = False
        .TextBox16.Visible = False
        .TextBox17.Visible = False
        .TextBox18.Visible = False
        .TextBox19.Visible = False
        .TextBox20.Visible = False
        .TextBox21.Visible = False
End With
 
Okay... Just took another Re-Read and see in your Title:

Help! textbox height can't even be manually changed!!!!

First of all is it a Worksheet or UserForm Textbox?

What exactly have you tried manually to change it? (without code)

It is a userform textbox. I did not mean to use manually that literally. To me, .textbox1.height=1600 is manually, as opposed to a formula or sorts.
Hardcoded (do you young people still use that term?) is what I really meant.

Gene Klein
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I am honestly not sure what this means.

Gene Klein
Select the textbox, press F4 to get the Properties pane up, autosize is one of the properties. You can also get the Properties pane up by right-clicking the textbox and choosing Properties.

Can you manually adjust the size of the textbox by dragging the grab handles?
 
Upvote 0
Where would I put this? At the start of each change module?
Straight after you've made changes you want to see - not normally needed but should force the issue. A DoEvents line might also help.:
Code:
Private Sub UserForm_Click()
With Me
    .TextBox1.Top = 30
    MsgBox .TextBox1.Top
    .TextBox1.Height = 160
    .Repaint
    'DoEvents
End With
End Sub
 
Upvote 0
Gene

Where do you have this code and when do you expect the controls to be resized?

Is it really in the userform's Click event?

PS The missing . in front of TextBox1 should make no difference.

As long as the code is in the userform module you can refer to controls by their name, you don't need to precede it with Me or the userform name.

PPS Kind of off topic, why do you have so many textboxes on the form and why are you resizing them?
 
Upvote 0
Gene

Where do you have this code and when do you expect the controls to be resized?

Is it really in the userform's Click event?

PS The missing . in front of TextBox1 should make no difference.

As long as the code is in the userform module you can refer to controls by their name, you don't need to precede it with Me or the userform name.

PPS Kind of off topic, why do you have so many textboxes on the form and why are you resizing them?
I am working on a project that compares the ten commandments in Exodus and Dueteronomy (they are different). I need different boxes because in each commandment, there may be more or less differences to detail.

Gene Klein
 
Upvote 0
Gene

That was an off-topic question.:)

What I was really asking was where the code was located etc.

PS Don't you have more than 10 textboxes?
 
Upvote 0
Gene

That was an off-topic question.:)

What I was really asking was where the code was located etc.

PS Don't you have more than 10 textboxes?
Most of the code is located in the checkbox_change events. When a user clicks on commandmentd number - the textboxes are changed. Yes I have more than 10 textboxes. If there are no differences in a commandments then I will have two for that checkbox. Why two? One for Exodus and one for Dueteronomy. If there are differences then each difference will have its own textbox - the idea is to isolate the differences.

Gene Klein
 
Upvote 0
The Repaint command would be after all the heights are adjusted etc.

About AutoSize, it is a property of the TextBox that makes the size of the TB dependent on the text inside rather than the .Height and .Width properties. If you are changing the heights of textboxes, it should be false for all of them.
 
Upvote 0
Gene

Is the code definitely being executed?

I assume it is since you've probably stepped through it while debugging, but you never know.:)
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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