Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Nov 13, 1998

Change the Appearance Property of a Text Box at Run Time

Sorry, you can't change the Appearance property of a text box at run time—but you can make it look like you have! If set to none, a 3-D picture box has a flat BorderStyle property. Put your text box (with a flat appearance) inside a picture box (with a 3-D appearance) and change the picture box's border style. Use this complete code-be sure you place Text1 inside Picture1:
 
Private m_Text1_Appearance As Long

Private Sub Form_Load()
	With Text1
		Picture1.Width = .Width
		Picture1.Height = .Height
		.Move 0, 0
	End With
	Text1_Appearance = 1  '3D
End Sub

Public Property Let _
	Text1_Appearance(nAppearance As Long)
	With Picture1
		Select Case nAppearance
			Case 0  'Flat
				.BorderStyle = nAppearance
			Case 1  '3D
				.BorderStyle = nAppearance
		End Select
	m_Text1_Appearance = .BorderStyle
	End With
End Property

Public Property Get Text1_Appearance() As Long
	Text1_Appearance = m_Text1_Appearance
End Property
Jim Deutch
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date