Announcement

Collapse
No announcement yet.

Easy Listbox question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Easy Listbox question

    If I have a listbox with say 5 or ten items in it and I want to modify a specific position, ie #3, how do you do that without using the Listbox Select/Listbox Add statement?
    I'm sure it's a sendmessage of some sort...
    I do have the numeric identifier (ie 3) vs the text in the window so doing it by pos& is OK..

    Thanks,

    Scott

    ------------------
    Scott
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

  • #2
    This is not possible i'm affraid.
    2 options

    1)
    Remove the specific item and use Insertstring instead of addstring.

    2)
    Use an ownerdraw box where you decide what's get 'printed'.



    ------------------
    hellobasic

    Comment


    • #3
      Something's telling me I already asked this question up here...hehe...

      This is what I am doing now:

      Code:
          'Scan to see if it is already in array
          Array Scan g_IEhWnd(), = hWndChild, To g_UrlIndexPtr
      
          If IsFalse g_UrlIndexPtr  Then 'Handle is new and has not been caught yet
             Incr g_URLIndex
             g_UrlIndexPtr = g_URLIndex 'Bring it up to date with index
             g_IEhWnd(g_UrlIndex) = hWndChild
             g_IEAddress(g_URLIndex) = Left$(wintext,wer)
             ListBox Add hDlg,%IDMAIN_LISTBOX1,g_IEAddress(g_URLIndex)
             Exit Function
          End If
          'Otherwise assume it's in here and modify it only.
          'Go to the position of the window handle inside the listbox and select text, then grab text
          ListBox Select hDlg, %IDMAIN_LISTBOX1,g_UrlIndexPtr
          ListBox Get Text hDlg, %IDMAIN_LISTBOX1 To sTmp
      
          If sTmp <> g_IEAddress(g_UrlIndexPtr) Then
              ListBox Delete hDlg,%IDMAIN_LISTBOX1, g_UrlIndexPtr
              ListBox Add hDlg,%IDMAIN_LISTBOX1,g_IEAddress(g_UrlIndexPtr)
          End If
      ------------------
      Scott
      Scott Turchin
      MCSE, MCP+I
      http://www.tngbbs.com
      ----------------------
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

      Comment

      Working...
      X