Frame1 scroll

Nirmalesh

New Member
Joined
Mar 28, 2022
Messages
20
Office Version
  1. 2007
Platform
  1. Windows
I have 1Frame control on user form.and
1label control and six textboxes under label. I want to do that when I scroll frame control then label control stay on their exact position as a header.
Actually I would like to make textbox grid. In this grid I use label control as header. How can I do this. Please vcçv
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
There are various ways to achieve this.

Method 1:
  1. Remove the scrollbar from Frame1
  2. Add another frame inside Frame1
  3. Give Frame2 a scrollbar
  4. Move the textboxes into Frame2
  5. Position the header label above frame2
  6. Edit the Frame2 properties so that it doesn't have a border (optional) and delete its name
1649084419234.png



Method 2:
  1. Remove the textboxes and replace by a Listbox.
  2. You can multiple columns in a listbox if you want a 'grid'
  3. You can give the listbox a scrollbar by not making it six rows high
  4. Move the label to above the listbox as a header
1649084597875.png



Method 3 (does not work on MacOS):
Use the ListView control. This is a control that you also see a lot of Windows dialog boxes. It has its own headers and a scrollable list underneath. In order to use this you need to add the reference to the Windows Common Controls. In VBA in the menu go to Tools, then References. Search for Microsoft Windows Common Controls 6.0, and tick the box. Now the Listview should be available in your toolbox.
You will have to readup on the web how to use the listview.

1649084692205.png
 
Upvote 0
There are various ways to achieve this.

Method 1:
  1. Remove the scrollbar from Frame1
  2. Add another frame inside Frame1
  3. Give Frame2 a scrollbar
  4. Move the textboxes into Frame2
  5. Position the header label above frame2
  6. Edit the Frame2 properties so that it doesn't have a border (optional) and delete its name
View attachment 61662


Method 2:
  1. Remove the textboxes and replace by a Listbox.
  2. You can multiple columns in a listbox if you want a 'grid'
  3. You can give the listbox a scrollbar by not making it six rows high
  4. Move the label to above the listbox as a header
View attachment 61663


Method 3 (does not work on MacOS):
Use the ListView control. This is a control that you also see a lot of Windows dialog boxes. It has its own headers and a scrollable list underneath. In order to use this you need to add the reference to the Windows Common Controls. In VBA in the menu go to Tools, then References. Search for Microsoft Windows Common Controls 6.0, and tick the box. Now the Listview should be available in your toolbox.
You will have to readup on the web how to use the listview.

View attachment 61665
No sir I want do do a dynamic list using frame label and texbox. I do not want to use listbox or listview it is easy. I want to do some different grid box using frame textboxe label.its challenge for me
 
Upvote 0
Please draw a userform showing how you want it to look. I will understand better. i thought Option 1 was what you are asking for.
 
Upvote 0
When I scroll frame scrollbar then label also go upward direction
 
Upvote 0
1) If I do Label1.top=Label1.top+6
Then it do proper but when I scroll up then label1 top added 6 and 6
2 if I do Label1.top= Frame1.scrolltop then it going proper way but some showing gap in label top
 
Upvote 0
This is my project but there is one proble when I scroll a scrollbar of frame1 then label also go upward direction and hide please resolve it
 

Attachments

  • IMG-20220406-WA0001.jpg
    IMG-20220406-WA0001.jpg
    169 KB · Views: 5
Upvote 0
Hi Nirmalesh, thanks for the screenshots.
Question: Why don't you have the labels outside the frame, Just above the frame. Then they won't move when you scroll. That is by far the simplest solution.
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,071
Latest member
cdnMech

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