Thread: How am i suppose to do this???

  1. #1
    Registered User darketernal's Avatar
    Join Date
    Sep 2001
    Posts
    41

    Question How am i suppose to do this???

    Does my hair look green as Grass well , moi adoree c++ and this is me first question.


    Ok i have one C++ builder 5

    i use 1 Empty form
    i use 1 RichEdit
    i use 1 SpeedButton

    Ok here is the problem

    let's say this box beneath here is the RichEdit1 on my empty form. ( Still following ??? )


    --------------------------------------------------------------------------------
    RichEdit1

    if i press the A button and hold it in on my keyboard you logically get this. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aa
    ---------------------------------------------------------------------------------

    The ScrollBar will follow the the letters downwards.


    ____________
    | SpeedButton1 | ok imagine this is a SpeedButton.
    -------------------

    On this SpeedButton1 i use a event called [ OnMouseMove ] So if i hold my mouse over it it will cause an event, and that is this following code

    //---------------------------------------------------------------------------
    void __fastcall TForm1::SpeedButton1MouseMove(TObject *Sender,
    TShiftState Shift, int X, int Y)
    {
    RichEdit1->Text=RichEdit1->Text+("a");
    }
    //---------------------------------------------------------------------------


    Then if i move my mouse over the SpeedButton it wil Generate the
    letter "a" on my RichEdit1 with ONE Difference

    here's the same RichEdit Box you saw before again. Using the OnMouseMove Event to produce numberous times the letter "a"


    -----------------------------------------------------------------------------
    RichEdit1

    Moving mouse over SpeedButton1 Generates the letter "a"

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaa
    -----------------------------------------------------------------------------
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa

    And then you will see that the RichEdit Dives under the txt so i cannot see anymore what the OnMouseMove event is generating, while if i press in the letter "a" on my keyboard RichEdit follows the text in the way i want.

    Does anyone understand what i mean by this???

    Thank you sincerly for any reply http://www.contrabandent.com/pez1/cwm/cwm3d/3dcool.gif

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    You must move the caret to the end of the RichTextBox. Have never used MFC so I don't know how to do this.
    // Gliptic

  3. #3
    Registered User darketernal's Avatar
    Join Date
    Sep 2001
    Posts
    41

    Unhappy

    , this is more diff than i thought, can't i just change it in properties??? , i need some sort of return function on the end of the line in the RichEdit o i can give some sort of ENTER so the line will go to the next one.

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    What? THAT sounds complicated and will not work probably. I don't know anything about MFC but in Win32 API code you can use messages to change the position of the caret in a RichEdit box.
    // Gliptic

  5. #5
    Registered User darketernal's Avatar
    Join Date
    Sep 2001
    Posts
    41

    Unhappy

    i want my mommy

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    Go and study the RichEdit class in MFC (If there is one). I don't feel like learning MFC because I don't think it is easier than pure Win32 API code.
    // Gliptic

  7. #7
    Registered User darketernal's Avatar
    Join Date
    Sep 2001
    Posts
    41

    Smile

    ok thnx , i'll try if anyone else knows a faster way......

  8. #8
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    What do you mean, faster way?
    // Gliptic

  9. #9
    Registered User darketernal's Avatar
    Join Date
    Sep 2001
    Posts
    41

    Unhappy

    Well i thought i might try an Coordinate x,y event that would influence the RichEdit1->Forcing it to go down when an OnMouseEvent handler is Called. C Builder is a visual utility do u know it?

  10. #10
    Unregistered
    Guest
    bytamin-c.com is a bbs dedicated to BCB. Someone there may be able to assist with specifics of your problem.

  11. #11
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    Well the problem is he's not using MFC - he's using BCB which is Delphi only you use C with it instead of Pascal.

    Try the site the last guy just gave you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 12-03-2008, 03:10 AM
  2. what is this suppose to be?
    By Yarin in forum C++ Programming
    Replies: 1
    Last Post: 11-18-2008, 11:41 AM
  3. is this how a function is suppose to work?
    By ktran03 in forum C Programming
    Replies: 14
    Last Post: 11-06-2008, 03:39 AM
  4. Replies: 6
    Last Post: 07-14-2008, 10:51 AM
  5. Program ideas...
    By code987 in forum C++ Programming
    Replies: 3
    Last Post: 11-18-2002, 11:41 PM