• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 446
  • Last Modified:

LineShape Manipulation

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
KJLC
Asked:
KJLC
  • 3
  • 3
1 Solution
 
CodeCruiserCommented:
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
 
KJLCAuthor Commented:
How would i detect that control is a Lineshape without casting it as a control?
0
 
CodeCruiserCommented:
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
KJLCAuthor Commented:
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
 
CodeCruiserCommented:
Ah. I think when you use shapes, a ShapeContainer1 object is added to the form. You can access all shapes using it.
0
 
KJLCAuthor Commented:
That's it thanks for the help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now