Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visual basic drawing a X based component locations

Posted on 2002-07-17
5
Medium Priority
?
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 4

Expert Comment

by:TigerZhao
ID: 7161115
PictureBox.AutoRedraw = True
0
 
LVL 6

Accepted Solution

by:
pierrecampe earned 480 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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.
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…
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…
Suggested Courses

636 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