Solved

LineShape Manipulation

Posted on 2013-01-30
6
425 Views
Last Modified: 2013-01-30
I have application that i am resizing on start up depending on the screen resolution.

I am able to resize all the controls on the form, by passing the form into a routine and iterating through the controls.

I cant work out how I can iterate through the  LineShape's on the form as they are not actual a control?

Thanks,

Ads
0
Comment
Question by:KJLC
[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
  • 3
6 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38834414
You can still find LineShape controls in form's control list but you can not cast these to Control. You have to cast these to LineShape.
0
 

Author Comment

by:KJLC
ID: 38834428
How would i detect that control is a Lineshape without casting it as a control?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38834670
Something like below

For Each ctrl In Me.Controls
   If Typeof(ctrl) Is LineShape Then
       Dim lctrl As LineShape = ctrl
       ...
   End If
End If
0
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!

 

Author Comment

by:KJLC
ID: 38834685
Hi, i tried this before but i get a compile error saying

systems.windows.forms.control can never be of type Microsoft.visulabasic.powerpacks.lineshape

This is where i am really stuck as far as i can see the LineShape is not a control

Thanks
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
ID: 38834728
Ah. I think when you use shapes, a ShapeContainer1 object is added to the form. You can access all shapes using it.
0
 

Author Closing Comment

by:KJLC
ID: 38834789
That's it thanks for the help
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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