none
Buffer does not give me right character ( win32 - Owner Drawn ListBox ) RRS feed

  • Question

  • Hi , Developers 

    listBox created in window class #32770 as OWNERDRAW when i want to retrieve itemdata , give me some strange character example i use addstring and character : "D" 

    Case WM_DRAWITEM 
    pdis as DRAWITEMSTRUCT

    Select Case pdis.itemaction 
    case oda_select 
    txtcount=SendMessageA(pdis.hwnditem,LB_GETTEXTLEN,0,0)
    buffer$=space$(txtcount+10)
    SendMessageA pdis.hwnditem,LB_GETTEXT,pdis.itemid,buff$
    debug.print buff$
    end select

    if no use listbox ( Style : Drawitem ) it gives me right character in each item as i see in listbox but when use drawitem to draw my listbox charaters change ( no english language or original format  added before ) and only one item of it showed me so where are the rest Added by LB_ADDSTRING?



    i have also problem in EM_SETCUEBANNER , text ( " mUser ") shown in strange language like chinesse or korean , i do not know why unicode 




    • Edited by Grailly Ali Tuesday, October 8, 2019 2:58 PM
    Tuesday, October 8, 2019 2:50 PM

Answers

  • Hi,

    According to your Code, your issue is more related about VB6. And this forum is discussing and asking questions about the vb.net.
    Ask in the following forum.

    Thank you for your understanding.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Grailly Ali Thursday, October 10, 2019 10:45 AM
    Thursday, October 10, 2019 6:18 AM
    Moderator

All replies

  • Hi

    Did you refer to THIS MS ITEM?


    Regards Les, Livingston, Scotland

    Tuesday, October 8, 2019 3:25 PM
  • yes but i do not know where is wrong , when  i use LBS_OWNERDRAW Do not show items in listbox and when want to get its text , retrieve me unicode string instead of text string 

    Tuesday, October 8, 2019 3:45 PM
  • Hello,

    If you are using VB.NET (some of your code appears to be VB6 so I'm indicating this for this reason) for EM_SETCUEBANNER using this code module. Then to use it SetCueText(SomeTextBox,"some text"). If you are asking for VB6 (and note this forum is only for VB.NET) see the following.

    In regards to the ListBox, you should post code that can be executed as the code shown can not be "as is".

    EDIT: I just noticed "ItemData", that is indeed VB6 unless I'm missing something. For VB6 questions use the following link.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange


    Tuesday, October 8, 2019 6:08 PM
    Moderator
  • hi,miss

    i used following 

    SendMessageA hEdit,EM_SETCUEBANNER,True,ByVal "User" 

    But still show unicode ( like chineese or k orean ) instead of text string i think not Support unicode 

    i created listbox and use Addstring to add 6 items when set ownerdraw they did not display

    how can draw all inside listbox and why show unicode instead of text string 

    tommorrow put a pic 

    Thanks 




    • Edited by Grailly Ali Tuesday, October 8, 2019 8:12 PM
    Tuesday, October 8, 2019 8:07 PM
  • Finally I Should apply 3 points but still cuebanner send unicode

    OWNER-DRAWN LISTBOX

    Wednesday, October 9, 2019 11:14 AM
  • Hi,

    According to your Code, your issue is more related about VB6. And this forum is discussing and asking questions about the vb.net.
    Ask in the following forum.

    Thank you for your understanding.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Grailly Ali Thursday, October 10, 2019 10:45 AM
    Thursday, October 10, 2019 6:18 AM
    Moderator
  • hi , Thank you i refer there 

    Thursday, October 10, 2019 10:45 AM