?
Solved

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

Posted on 2003-03-06
5
Medium Priority
?
245 Views
Last Modified: 2010-05-01
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
Comment
Question by:tonyleung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Expert Comment

by:navneet77
ID: 8085459
You can change the scale mode of the form to 3-resolution
and then do text1.width = picture1.width
0
 
LVL 1

Expert Comment

by:Bandy
ID: 8085561
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
 
LVL 11

Expert Comment

by:supunr
ID: 8085576
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
 

Author Comment

by:tonyleung
ID: 8085931
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
 
LVL 2

Accepted Solution

by:
navneet77 earned 150 total points
ID: 8086345
try
Text1.Width = ScaleX(picture1.Width, vbPixels, vbTwips)
Text1.height = ScaleY(picture1.height, vbPixels, vbTwips)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question