|
-
Mar 25th, 2006, 04:48 PM
#1
Thread Starter
No place like 127.0.0.1
[RESOLVED] Getting The .NET Equivalent of .ScaleWidth in VB6
I am trying to do the following...
VB Code:
TextBox1.Left = 15
Me.Width = TextBox1.Right + 15
But the padding (of 15) is not the same on both sides. It seems like I need to be dealing with the VB6 equivalent of ScaleWidth. Any ideas?
-
Mar 25th, 2006, 05:18 PM
#2
Re: Getting The .NET Equivalent of .ScaleWidth in VB6
lol, I was asking the same some days ago. There is no direct way to replace these methods (they are are no more supported): Scalemode, ScaleLeft, ScaleTop, ScaleWidth, ScaleHeight.
This link talks about this and presents a solution, but, I have to say I still can't find a way to create a coorditante system in VB.Net as we use to do it in VB6. Anyway, maybe this is the answer you're looking for..
http://msdn.microsoft.com/library/de...l/vbup2038.asp
-
Mar 25th, 2006, 05:26 PM
#3
Thread Starter
No place like 127.0.0.1
Re: Getting The .NET Equivalent of .ScaleWidth in VB6
I guess my question breaks down to a few things:
1) Does the Form.Width property return the width of the form (including the form border)?
2) Does the .Left property return the distance from the inner boundry of the form (not including the border) or the outer boundry (including the form).
If the answer is yes to both of those, then why is there no way to get the width of the border of the form? That seems crazy to me.
-
Mar 25th, 2006, 05:31 PM
#4
Re: Getting The .NET Equivalent of .ScaleWidth in VB6
It is the Size of the form in pixels. So Width is in pixels and not twips etc.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 25th, 2006, 05:33 PM
#5
Re: Getting The .NET Equivalent of .ScaleWidth in VB6
If you want the size without the borders then you can use the ...
Me.ClientSize.Width() for no borders.
Me.ClientSize.Height() will return the height - the borders and menu, if any.
If your setting the width and height then just set the .Size property instead.
Width or the borders can be calculated by (Me.Width - Me.ClientSize.Width) / 2
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 25th, 2006, 05:46 PM
#6
Thread Starter
No place like 127.0.0.1
Re: Getting The .NET Equivalent of .ScaleWidth in VB6
Thanks RobDog. That's just what I needed.
-
Mar 25th, 2006, 06:54 PM
#7
Re: [RESOLVED] Getting The .NET Equivalent of .ScaleWidth in VB6
Oh ya, and heres a bonus one - To set the position of a form (right docked appearance for ex.) use
Me.Location = New System.Drawing.Point(Screen.PrimaryScreen.Bounds.Width - Me.Width, Screen.PrimaryScreen.Bounds.Height - Me.Height)
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 5th, 2009, 11:16 PM
#8
New Member
Re: [RESOLVED] Getting The .NET Equivalent of .ScaleWidth in VB6
Thanx, this is just what I've been looking for.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|