HELP: cursor position ?'s and Save file ?'S 
Author Message
 HELP: cursor position ?'s and Save file ?'S

Hi,
I have two questions:
1). I have a text to edit in a textbox( main form). From the "Insert"
menu of the latter, you can opnen a list box  where you can choose from
its text field a piece of text (say "Date of today is Oct. 7") and then
select to insert it into the text you're editing. I just don;t know
WHERE and HOW to find the CURRENT CURSOR POSITION  so that I can append
the chosen text from the textfield to the current text, and then
continue to edit the text in the main field.

2.) How can I save the text that I finished editing in the above text
form? "Obj.ShowSave" does give me a (dummy) "Save File" dialogue box,
but there were no "File type" in it and pushing "Save" button has no
effect whatsoever: nothing saved. I want to know how I can set the "Save
File as" type and how to actually save it.

Thanks to anyone who can help me in this regard, but no thanks to the VB
Help writers nor my prof.



Thu, 28 Mar 2002 03:00:00 GMT  
 HELP: cursor position ?'s and Save file ?'S

Quote:
> 1). I have a text to edit in a textbox( main form). From the "Insert"
> menu of the latter, you can opnen a list box  where you can choose from
> its text field a piece of text (say "Date of today is Oct. 7") and then
> select to insert it into the text you're editing. I just don;t know
> WHERE and HOW to find the CURRENT CURSOR POSITION  so that I can append
> the chosen text from the textfield to the current text, and then
> continue to edit the text in the main field.

The current caret position in a textbox is retrieved using the SelStart
property. The simplest way to do what you're trying to do is something like
Text1.SelText = "SomeText", which will insert "SomeText" at the position where
the caret is currently at. Note that if you have text selected this will replace
it. You can test for that using SelLength, which returns the number of
characters selected. If that is zero, then no text is selected.

Quote:
> 2.) How can I save the text that I finished editing in the above text
> form? "Obj.ShowSave" does give me a (dummy) "Save File" dialogue box,
> but there were no "File type" in it and pushing "Save" button has no
> effect whatsoever: nothing saved. I want to know how I can set the "Save
> File as" type and how to actually save it.

I assume you refer to the Common Dialog control here? You need to set the Filter
property for a list of file types to show up on the combo. The dialog will
return a filename if the user types one in and hits OK, so once you have that
filename you use it as the path to open and write the data you want to save. The
control does not magically save anything, that's something you have to do for
yourself. It merely returns a filename for you to work with.

Quote:
> Thanks to anyone who can help me in this regard, but no thanks to the VB
> Help writers nor my prof.

The help system is not very good, but it's not a tutorial, either. And I'd think
your prof did not give you the whole solution precisely because you're supposed
to figure it out on your own. Otherwise how will you learn?

~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please post/reply to the newsgroup(s)

Klaus H. Probst
http://members.xoom.com/kprobst/
~~~~~~~~~~~~~~~~~~~~~~~~~~~



Thu, 28 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Can't save BLOB from RS to Variable to File without extra char's

2. 'Activedocument.saved = false' after save

3. help on 'save myType'..

4. Need help with VB's messed up file saving

5. **************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Help me !!!!!!!!!!!!!!!!!!!!!!!!'''''''''''''''''''''''*************

6. How to 'print to file' or 'save to file'...

7. Internet 'hand' mouse cursor

8. VB4's SS Option Button

9. Microsoft Cursor Engine error '8007000e'

10. ss Problem's

11. Autoshape 'z' positioning

12. Autoshapes 'Z' positioning

 

 
Powered by phpBB® Forum Software