hello, i'm making a program in which i need to place the controls relative to the size of the form..so could anyone tell me how to get a form's height and width form a code???
Use the reserved word "Me" to refer to the form; then use the ScaleWidth and ScaleHeight properties. Since those numbers are dependent on the ScaleMode, you will have to make sure you translate (e.g. from twips to pixels) if necessary to get the proportions right.
Then, in the Form_Resize event procedure, do some arithmetic to proportionately set the top and left properties of the controls that move, and the width and height properties of the controls that have to stretch/shrink.
thank you for your reply..it helped me to get the width and height but i would like to ask one for question..which scalemode is better twips or pixel??
Twips are finer granularity. You can look in the help file to get a more detailed explanation.
Personally, I prefer to use twips as they are device-independent. They also make for better looking graphics (if your app uses graphics objects). You don't have to worry about the resolution of the user's monitor so much. But, the numbers you manipulate are larger and you have to do some additional arithmetic to translate some of the measurements, so for some people it's a little disconcerting.
thank you for your reply..i googled about twips and pixels and found out that
15 twips=1 pixel
so can I write the following code to calculate the screen position of controls in pixels because I also came across the use of WinAPI functions like GetDC() and GetDeviceCaps() which has confused me a little bit
Dim WidthInPixels,HeightInPixels as integer WidthInPixels = Me.ScaleWidth * 15 HeightInPixels = Me.ScaleHeight * 15
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Hello All ...
Iam Getting An Error With try to excecute the stored procedure .
I have Have Sql database , the stored procedure like so :
USE [MPRS] GO /****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Here is the sample output that I ...