Solved

Visual basic drawing a X based component locations

Posted on 2002-07-17
5
151 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
ID: 7161115
PictureBox.AutoRedraw = True
0
 
LVL 6

Accepted Solution

by:
pierrecampe earned 120 total points
ID: 7161121
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
ID: 7161125
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
ID: 7161128
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
ID: 7161171
Thank you very much. I have tried for over a week to figure this one out. Good Work.
Sincerely,
Arrummzen
0

Featured Post

Industry Leaders: 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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

713 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