473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to scroll more smooth

I've created an empty tabpage. At runtime i add lots of controls with
this function:

For i = 0 To mani_settings.count
Dim index
Dim label As New Label
label.Top = 12 + i * 26
label.Left = 8
label.AutoSize = True
label.Text = mani_settings.settings(i).name
index = labels_mani_settings.Add(label)

Me.TabPage2_Mani_Settings.Controls.Add(labels_mani _settings(index))
ToolTip1.SetToolTip(labels_mani_settings(index),
mani_settings.settings(i).description)
Dim textbox As New TextBox
textbox.Top = 12 + i * 26
textbox.Left = label.Width + 14
textbox.Width = Me.TabPage2_Mani_Settings.Width -
label.Width - 22
textbox.Height = 20
textbox.Text = mani_settings.settings(i).value
index = textboxes_mani_settings.Add(textbox)

Me.TabPage2_Mani_Settings.Controls.Add(textboxes_m ani_settings(index))
ToolTip1.SetToolTip(textboxes_mani_settings(index) ,
mani_settings.settings(i).description)
Next

Now there are two problems. First if i scroll the tabpage it looks very
ugly. Because it doesen't repaint correctly. if i do a update() on the
form throug the onscrolling event of the tabpage it is better but not
perfect.

The second problem is that it takes about 10 seconds to create all
those controls. This is a bit slow, i think.

Do you now any solution to solve these two problems?

Thanks,

peng12341

Dec 23 '05 #1
2 2434
Nobody here hwo can help me?

Dec 24 '05 #2

Regarding the second problem:

Have you looked at the Control.SuspendLayout method in
the online help?

"When adding several controls to a parent control, it is recommended
that you call the SuspendLayout method before initializing the
controls to be added. After adding the controls to the parent control,
call the ResumeLayout method. This will increase the performance of
applications with many controls."

But perhaps you should replace the whole thing with a ListView or
grid control of some sort. I won't go into that as I have no idea what
kind of look you are striving for.

/JB

On 23 Dec 2005 04:15:56 -0800, "peng12341" <pe*******@gmail.com>
wrote:
I've created an empty tabpage. At runtime i add lots of controls with
this function:

For i = 0 To mani_settings.count
Dim index
Dim label As New Label
label.Top = 12 + i * 26
label.Left = 8
label.AutoSize = True
label.Text = mani_settings.settings(i).name
index = labels_mani_settings.Add(label)

Me.TabPage2_Mani_Settings.Controls.Add(labels_man i_settings(index))
ToolTip1.SetToolTip(labels_mani_settings(index),
mani_settings.settings(i).description)
Dim textbox As New TextBox
textbox.Top = 12 + i * 26
textbox.Left = label.Width + 14
textbox.Width = Me.TabPage2_Mani_Settings.Width -
label.Width - 22
textbox.Height = 20
textbox.Text = mani_settings.settings(i).value
index = textboxes_mani_settings.Add(textbox)

Me.TabPage2_Mani_Settings.Controls.Add(textboxes_ mani_settings(index))
ToolTip1.SetToolTip(textboxes_mani_settings(index) ,
mani_settings.settings(i).description)
Next

Now there are two problems. First if i scroll the tabpage it looks very
ugly. Because it doesen't repaint correctly. if i do a update() on the
form throug the onscrolling event of the tabpage it is better but not
perfect.

The second problem is that it takes about 10 seconds to create all
those controls. This is a bit slow, i think.

Do you now any solution to solve these two problems?

Thanks,

peng12341


Dec 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: delong | last post by:
Hi I am trying to display a large image on the form and make the form scrollable. My image is about 4200 x 7000 pixel. private void Form1_Paint(object sender,...
0
by: Tolga | last post by:
Is there a way to make the data grid scroll smoothly instead of scrolling row by row?
2
by: Geoff Jones | last post by:
Hi I have been using a smooth progress control using the following link: http://support.microsoft.com/default.aspx?scid=kb;en-us;323088#2 It works well, however I can't seem to get it to...
0
by: deepuk75 | last post by:
Hi all, I have a user control that contains a picturebox within a panel. the panet has autoscroll property set to true.The problem I am facing is with the thumb track. if drag the scroll bar, the...
4
by: petermichaux | last post by:
Hi, Is there any way to make DOM scripted animation smoother? Flash is far superior in this area. Any one here know what makes Flash so smooth by comparison? I don't like the fact that the...
3
by: Richard Lewis Haggard | last post by:
I have an unbound DataGridView control that has some cells that may contain more multi-line text than can be completely displayed in the available screen space. When the height of its row to...
4
by: mateusz.zajakala | last post by:
Hi, I have panel (with autoscroll property) on which I'm dynamicaly adding of controls. When I want to scroll my panel using scrollbars it freezes all the controls added on that panel, makes...
1
by: Rubikzube | last post by:
I have JavaScript functions on my page that insert and remove DOM elements, and it's causing the browser to rescroll to the top of the window. I was wondering what the cause of the behavior is and...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.