• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

How can i set the height and width of textbox as the picturebox?

Dear all,
The picturebox scalemode is set as "3-resolution".
How can i set the height and width of textbox same as the height and width of the picturebox?
Do i need to do some calculation on the translation?
Tony Leung
0
tonyleung
Asked:
tonyleung
1 Solution
 
navneet77Commented:
You can change the scale mode of the form to 3-resolution
and then do text1.width = picture1.width
0
 
BandyCommented:
Or if you don't want to change the scale mode of the form, have a look at "ScaleX" and "ScaleY" functions of the form.

They can be used to convert between, (eg) twips & pixels, etc.
0
 
supunrCommented:
do you have the textbox inside the picturebox? if that is the case, then set
text1.width = picture1.scalewidth
text1.height = picture1.scaleheight

otherwise...
OldScaleMode = me.scalemode
me.scalemode = picture1.scalemode
text1.width = picture1.width
text1.height = picture1.weight
me.scalemode = OldScaleMode

sould work???
0
 
tonyleungAuthor Commented:
i found that if the textbox is place in the form(set scalemode to 3)...
text1.width = picture1.width
text1.height = picture1.width
it is work!
However, if the textbox is place in the SSTab(Component: Microsoft Tabbed Dialog Control), it is not work!
Any other method?
0
 
navneet77Commented:
try
Text1.Width = ScaleX(picture1.Width, vbPixels, vbTwips)
Text1.height = ScaleY(picture1.height, vbPixels, vbTwips)
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now