Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3
This is the forum to discuss the Wrox book Beginning C# 3.0 : An Introduction to Object Oriented Programming by Jack Purdum; ISBN: 9780470261293
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 8th, 2010, 08:36 PM
Registered User
 
Join Date: Nov 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Rich Text Boxes and their pesky cursors

Greetings. When I'm not studying the book, I've been writing a little Windows word processor application using a Rich Text Box. One quick question. How do I put the blinking cursor at the top left (the 0,0 coordinates) of the rich text box so that the user can begin typing immediately (after the application loads and the form displays) instead of having to move the mouse over to that position and clicking? Just giving the rich text box 'focus" doesn't do the trick, and I've tried a few other commands that didn't work either. It's a minor thing, but it bugs me that I can't get this to work. THANKS!

Bob
  #2 (permalink)  
Old March 9th, 2010, 05:46 PM
Friend of Wrox
Points: 1,166, Level: 13
Points: 1,166, Level: 13 Points: 1,166, Level: 13 Points: 1,166, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2008
Location: Indianapolis, IN, USA.
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default RTB

Not sure what the problem is. I put a button on a form with a rich text box and put this line in the button click event:

rtc.Focus();

and when I click the button, the cursor appeared in the rtb. Try it and see if that's what you need.
__________________
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)
  #3 (permalink)  
Old March 9th, 2010, 06:23 PM
Registered User
 
Join Date: Nov 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Boxes and their pesky cursors

Thanks for your response, but giving the rich text box focus doesn't put the cursor at the upper left of the box and ready for input. If the "focus" command is supposed to work this way, then perhaps something is goofy in the way I set the control up. I want this to work like Wordpad does. When you open Wordpad, the cursor is already at the top left of the form and ready for input, no clicking required by the user. That's all I'm looking for here.
  #4 (permalink)  
Old March 11th, 2010, 01:54 AM
Friend of Wrox
Points: 1,166, Level: 13
Points: 1,166, Level: 13 Points: 1,166, Level: 13 Points: 1,166, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2008
Location: Indianapolis, IN, USA.
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default Cursor in RTB

Do you have the tab index for the RTB as the first one in the list of controls? If some other control has a lower tab index, it will gain focus first. (I'm assuming you already did this, but this would cause the problem to manifest itself.)
__________________
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)
  #5 (permalink)  
Old March 11th, 2010, 11:06 PM
Registered User
 
Join Date: Nov 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Rich Text Boxes and their pesky cursors

Jack,
You were 100% correct. It was the tab control that was giving me the problem. I guess I had a brain freeze concerning the tabs. There was a button on my form that had a tab index of 2, and that's where the focus was being held when the application started. I changed my rich text box to a tab index of 1 and voila, the problem was solved. It's always the little things that come back to bite you! Thanks for your help.

Bob C.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing pesky dialog boxes. FalseParadigm Access VBA 22 July 20th, 2007 08:47 AM
Rich Text Boxes speedlearner Pro VB 6 2 July 2nd, 2006 09:02 AM
Rich Text Boxes speedlearner All Other Wrox Books 1 June 22nd, 2006 08:04 AM
Rich Text Editor PC User Access 0 June 5th, 2004 04:04 PM



All times are GMT -4. The time now is 11:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.