Solved

Visual basic drawing a X based component locations

Posted on 2002-07-17
5
146 Views
Last Modified: 2013-11-25
How can a make an X appear over a image/picture box control with the on click event. I want to use the line function to make a X over the image Box. I am thinking about using the. height .width  .left and .top variables of the image box witch seems to work fine wen the image/picture box is at the center of the page but when It is of to the side the X is distorted.Is this possible or is there a better way?
Thank you,
Arrummzen
0
Comment
Question by:Arrummzen
  • 3
5 Comments
 
LVL 4

Expert Comment

by:TigerZhao
Comment Utility
PictureBox.AutoRedraw = True
0
 
LVL 6

Accepted Solution

by:
pierrecampe earned 120 total points
Comment Utility
Private Sub Command1_Click()
    Me.AutoRedraw = True
    Picture1.AutoRedraw = True
   
    Picture1.Line (0, 0)-(Picture1.ScaleWidth, Picture1.ScaleHeight), vbRed
    Picture1.Line (Picture1.ScaleWidth, 0)-(0, Picture1.ScaleHeight), vbBlue

    Me.Line (Image1.Left, Image1.Top)-(Image1.Width + Image1.Left, Image1.Top + Image1.Height), vbYellow
    Me.Line (Image1.Left, Image1.Top + Image1.Height)-(Image1.Width + Image1.Left, Image1.Top), vbGreen
End Sub
0
 
LVL 6

Expert Comment

by:pierrecampe
Comment Utility
Arrummzen
i see you are new here
so please read the tips about comments and answers at the bottom of this page
Thanks
0
 
LVL 6

Expert Comment

by:pierrecampe
Comment Utility
Hi Tiger
still up at this hour in the morning ?
over here it is 4 in the morning (belgium)
0
 
LVL 1

Author Comment

by:Arrummzen
Comment Utility
Thank you very much. I have tried for over a week to figure this one out. Good Work.
Sincerely,
Arrummzen
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now