Solved

Visual basic drawing a X based component locations

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

816 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

10 Experts available now in Live!

Get 1:1 Help Now