RE: Create custom rectangle UI Element

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi,

I'm not sure if you're referring to System.Windows.Shaps.Rectangle:

#Rectangle Class (System.Windows.Shapes)
http://msdn2.microsoft.com/en-us/library/system.windows.shapes.rectangle.asp
x

This class cannot be inherited. It's actually only a special Shape:

#Shape Class (System.Windows.Shapes)
http://msdn2.microsoft.com/en-us/library/system.windows.shapes.shape.aspx
Provides a base class for shape elements, such as Ellipse, Polygon, and
Rectangle. This class is abstract.

The ultimate base class of them is the UIElement class:

#UIElement Class (System.Windows)
http://msdn2.microsoft.com/en-us/library/system.windows.uielement.aspx
UIElement is a base class for WPF core level implementations building on
Windows Presentation Foundation (WPF) elements and basic presentation
characteristics.


To create a visio like application, you need to manage many objects of type
UIElement, not a specific type Rectangle.

I suggest you start with following example:

#Dragging Elements in a Canvas - The Code Project - Windows Presentation
Foundation
http://www.codeproject.com/WPF/DraggingElementsInCanvas.asp

Then choose relevant samples from:

#Download details: Windows SDK .NET Framework 3.0 Samples
http://www.microsoft.com/downloads/details.aspx?FamilyID=22b58b6c-8f98-40d0-
880d-c3339c5da01e&displaylang=en


Hope this helps.

Sincerely,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Create custom rectangle UI Element
    ... #Rectangle Class ... The ultimate base class of them is the UIElement class: ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.general)
  • RE: TreeView multiple selections
    ... But with this behavior I can't draw a node to normal after selecting twice ... .Net2.0 has added the build-in support for custom-draw. ... rectangle based on your requirement. ... Dim focusPen As New Pen ...
    (microsoft.public.dotnet.general)
  • I encounter the same error, but my data does not have the benefit of record tags.
    ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ... where an initial response from the community or a Microsoft Support ... I am having trouble creating one input flat file. ...
    (microsoft.public.biztalk.general)
  • Re: System Error (1003) - 0x000000CB
    ... MCSE, CCEA, Microsoft MVP - Terminal Server ... A call to Microsoft Support seems appropriate. ... Computer: TERMSERVER1 ...
    (microsoft.public.windows.terminal_services)
  • Re: How do I Sleep for a specified amount of time and relinquish c
    ... Finally, the Windows thread scheduling is not a trivial topic, it is ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework)