Solved

How do I allow users to resize dynamically created textboxes in WPF

Posted on 2008-10-13
2
1,240 Views
Last Modified: 2013-11-12
I'm building a tool as a method for learning WPF, its a form creator where I'm allowing users to dynamically add labels, textboxes, etc.  

With my current code the user can add a textbox and drag and drop the textbox anywhere they like.  Now I need to give he user the ability to resize the textbox.  Is that possible?  Ideally I'd like to give the user the little dots on all sides to allow them to drag the textbox bigger.

Thanks in advance!
0
Comment
Question by:dndorksadmin
2 Comments
 
LVL 8

Accepted Solution

by:
adler77 earned 500 total points
ID: 22709012
I'm coming at this from the Silverlight side, so there may be a more elegant way in WPF (or SL for that matter!), but what if the TextBlock was wrapped in a Grid that is custom-styled with Rectangle "handles" in the right places. Those handles have drag/drop code that repositions/resizes the Grid when you release the mouse button. With the Grid resized, the TextBlock should autosize to fit the Grid.

Would this work for what you need?
0
 

Author Comment

by:dndorksadmin
ID: 22711705
Hmm, that makes a lot of sense.  I'm actually decorating objects when I drag them at the four corners, so perhaps it won't take much to add code to handle resizing the object.  I'll take a look at it tonight when I get home!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now