Draging objects on a form at runtime

  • 13 years ago

    Hi,

    I'm not able to "float" a ToolStrip around a form at runtime. I can Dock it to any edge of the form during design, or fix it in the middle, but not float it when I run the code! More generally, I'd like to "float" other controls (e.g. Button, PictureBox) and rectangles drawn by System.Drawing.Graphics too (In much the same way as you can move Shapes in Excel). Apart from a brain, am I missing something simple?

    Thanks in advance for any help you can give.

  • 13 years ago
    Have a look in the Help file under 'ToolStrip Class / Events / BeginDrag / Example' - there's some sample code related to dragging a ToolStrip.  
  • 13 years ago

    Thanks for the tip. I checked the example and can now "float" a ToolStrip in any one of the four side panels of a ToolStripContainer. However, I'm not able to float over the CentrePanel of the ToolStripContainer or just float a ToolStrip without a ToolStripContainer. I'll keep trying.

    Also, regarding how to float Shapes on a form, I found an interesting article when I searched Help for "Shape Library" entitled "Microsoft .NET Shape Library: A Sample Designer". This discusses a .NET Shape Library that appears to let you generate/float shapes on a form but after downloading the library it fails to install (error message "The folder path '.NET Shape Library: A Sample Designer" contains an invalid character.") Has anyone managed to access this library?

    Thanks again in advance.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In order to understand recursion, one must first understand recursion.”