Results 1 to 5 of 5

Thread: Cursor

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Ruinen, Drente, Netherlands
    Posts
    192

    Post

    I put this code in a program for having a bigger cursor for EVERY textbox:

    Private Sub txtOrdArtikelnr_GotFocus()
    h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
    End Sub
    Private Sub txtOrdArtikelOms_GotFocus()
    h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
    End Sub
    Private Sub txtOrdaantal_GotFocus()
    h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
    End Sub
    Private Sub txtOrdEenheid_GotFocus()
    h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
    End Sub
    Private Sub txtOrdPrijs_GotFocus()
    h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
    End Sub

    And several more of these sub's. I think this can be done better and easy'er. Any one have suggestions ?


    ------------------

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Create a Textbox Control Array, then you can use the Same piece of code for all the Textboxes.

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  3. #3
    Member
    Join Date
    Jan 1999
    Location
    Garden Grove, CA, Orange
    Posts
    55

    Post

    It would much easier if u created those textboxes as control array in first place.
    Just place the code in one sub
    Private Sub txtOrder_GotFocus(Index as Integer)
    h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
    End Sub


    Make it sub and call it, not much but u can reduce some code their

    Delcare as public in module if diffrent forms call it

    private sub BigCursor()

    h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)

    end sub

    Joon

    [This message has been edited by jpark (edited 12-16-1999).]

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Ruinen, Drente, Netherlands
    Posts
    192

    Post

    Thanks Aaron and Joon for the fast reply. This will work but I still have to make a sub for every textbox in the program for calling the BIGCURSOR. What I was thinking was: When in the whole program a textbox got the focus (GotFocus) the cursor become's big.
    (maybe you can give me an example off a textbox control array ?, I am not quit understanding what this means)

    ------------------

  5. #5
    Member
    Join Date
    Jan 1999
    Location
    Garden Grove, CA, Orange
    Posts
    55

    Post

    Why do u have to make the sub for every textbox? Make one and call it for each textbox's GotFocus event.

    Textbox control array example

    On the Form, draw a TextBox, and name it.
    (In this example, I called it "txtOrder")

    Copy the textbox and paste it as many as u need.
    (When first one is pasted, the massagebox will ask u to create control array.)

    Put the code to change a big picture in the GotFous events of txtOrder textbox control array.

    Private Sub txtOrder_GotFocus(Index as Integer)
    h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
    End Sub

    Joon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width