LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default placing controls

I am dynamically creating controls on a vba userform. Now I had to face the
fact, that even though I use integers to place these controls using their
TOP, LEFT, HEIGHT and WIDTH properties, there is almost always a slight
different from the actual view to what I try to draw. This is best seen if
there are several controls that have just a small space between them. The
userforms then look really improper.
Has somebody experience with this issue? Do I have to put my controls into a
certain grid to get better results?
Thanks for any hints.
Luc

To reproduce this issue create a userform, put following code into its code
panel and show it. The created rectangles SHOULD have a constant spacing of
2 point.

' *** start of code ***
Private Sub UserForm_Initialize()
With Me.Controls.Add("Forms.Image.1")
.Top = 5
.Left = 5
.Height = 50
.Width = 50
End With
With Me.Controls.Add("Forms.Image.1")
.Top = 7
.Left = 7
.Height = 46
.Width = 46
End With
With Me.Controls.Add("Forms.Image.1")
.Top = 9
.Left = 9
.Height = 42
.Width = 42
End With
With Me.Controls.Add("Forms.Image.1")
.Top = 11
.Left = 11
.Height = 38
.Width = 38
End With
With Me.Controls.Add("Forms.Image.1")
.Top = 13
.Left = 13
.Height = 34
.Width = 34
End With
With Me.Controls.Add("Forms.Image.1")
.Top = 15
.Left = 15
.Height = 30
.Width = 30
End With
End Sub
'*** end of code ***


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Placing an UDF yshridhar Excel Worksheet Functions 11 August 17th 07 02:01 AM
placing.. 1st, 2nd, 3rd... fivermsg Excel Discussion (Misc queries) 1 March 14th 06 02:21 AM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
placing Stig Excel Worksheet Functions 0 February 3rd 05 10:30 PM


All times are GMT +1. The time now is 10:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"