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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Mar 23, 2000

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Tile With Lightweight Image Control Arrays

I write apps for companies where computer know-how is at an all-time low. Most applications scare people to death. However, Web-style forms and graphic buttons present soothing enough interfaces that they can be inviting to users.

I wanted my forms to look just like a Web page, so I devised a method to replicate and tile one Image control across a form. To achieve this effect, add an Image control to your form, set its Index to zero, set Visible to False, and set an appropriate background image for the Picture property. Pass your form to the CreateBackground routine during its Load event:
 
Private Sub Form_Load()
	Call CreateBackground(Me)
End Sub
Public Sub CreateBackground(frmCallingParent)
	Dim lTilesY As Long, lTilesX As Long
	Dim lLeft As Long, lTop As Long
	Dim oImg As Image
	Dim X As Integer
	Set oImg = frmCallingParent.Image1(0)
	lTilesX = oImg.Width
	lTilesY = oImg.Height
	Do While lTop < Screen.Height
		X = X + 1
		Load frmCallingParent.Image1(X)
		Set oImg = frmCallingParent.Image1(X)
		With oImg
			.Left = lLeft
			.Top = lTop
			.Visible = True
		End With
		lLeft = lLeft + lTilesX
		If lLeft > Screen.Width Then
			lLeft = 0
			lTop = lTop + lTilesY
		End If
	Loop
End Sub
Craig R.
 
Comment and Contribute

 

 

 

 

 


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

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date