?
Solved

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

Posted on 2008-10-13
2
Medium Priority
?
1,278 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
[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
2 Comments
 
LVL 8

Accepted Solution

by:
adler77 earned 1500 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

770 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