Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2006

Tip: Looking for answers? Try searching our database.

Retained mode textbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pyda001@ec.auckland.ac.nz - 29 Jun 2006 06:25 GMT
I'm making a retianed mode drawing system. In my application I want to
make the users able to create textboxes similar to the ones used in
e.g. PowerPoint.

So far the application lets the user create the textboxes. My issue
arises when the user doubleclicks the textbox and I superimpose a
RichTextBox exactly over the extents of my retained mode textbox. The
user should be able to edit the text in the textbox, but no matter how
I tweak the RichTextBox it moves the text slightly compared to the
underlying text. I can also foresee an upcoming problem when I let the
user have two or more fonts in the same textbox.

Anyone have dealt with this before? Is the RichTextBox the right
control to use or should I recreate this entire control from scratch?

- Peder -
William Sullivan - 30 Jun 2006 15:56 GMT
Why not just replace the textboxes with RichTextBoxes?

Alternatively, bring up a small form to allow users to enter text, then
populate the text boxes with the results of this operation?  

Personally, I'd try to just use RTB's everywhere.  But I'm lazy.

> I'm making a retianed mode drawing system. In my application I want to
> make the users able to create textboxes similar to the ones used in
[quoted text clipped - 12 lines]
>
> - Peder -
pyda001@ec.auckland.ac.nz - 30 Jun 2006 18:05 GMT
Maybe I wasn't making myself clear enough so I'll try to explain once
more.

I'm creating a retained mode drawing system. A textbox in this context
is not a control, but a GDI+ drawn element using DrawRectangle(),
FillRectangle, and DrawString(). However, it seems text rendering is
different in GDI+ and inside the RichTextBox. It either doesn't fit
right, wraps around the wrong way, or has the wrong width compared to
DrawString.

I picture I could create a control that behaves like a RichTextBox and
does my work, but this is a lot of work if there is a simpler solution.
I'm sure this has been solved before, hence this post.

Anyone?

- Peder -
William Sullivan - 30 Jun 2006 19:39 GMT
Well, I don't think its either a simple problem or that anybody else has
tried to do this before.  I think your best bet would be to pop up a form
that takes the imput rather than try to fool the user into thinking they are
manipulating the text on the image itself.  Good luck on the prob, tho.

> Maybe I wasn't making myself clear enough so I'll try to explain once
> more.
[quoted text clipped - 13 lines]
>
> - Peder -
pyda001@ec.auckland.ac.nz - 30 Jun 2006 23:02 GMT
Well, I never said I thought it would be a simple problem. On the
contrary. However, the dialog-box solution is exactly what I want to
avoid. I'm making a "presentation program light" as my thesis project
and would like to mimic the PowerPoint-style textboxes. They should
support in-place editing or the interface will become a joke. So far
I'm just out fishing for ideas on how to do this. I can picture
developing a new control which behaves almost exactly like the
RichTextBox, but that uses drawstring to refresh the graphics instead
of the built-in rendering of the RichTextBox. However, this will mean a
hellofalot of work if you take into account all the different events,
mouse selecting of text, cutting, copying, pasting, indenting,
bulleting, and so on.

- Peder -

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.