Solved

Visual basic drawing a X based component locations

Posted on 2002-07-17
5
150 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

808 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