TsListbox custom WindowProc lost after clear

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #38176
    JM-DG
    Participant

    Hi!

    Following up my “Reposition control depending of TsListBox vScrollbar visibility” question,

    I think I have discovered a bug happening when you assign a custom WindowProc procedure to a TsListBox.

    Once there has been no more items in the listbox (either cleared or removed one by one), it seems like the component lose its custom WindowProc assignation.

    At first launch of application:

    2ab1ef5453433c155b4fc2ac821622ca.gif

    Once the listbox has been cleared completely at least once:

    b98e5df1c3c4736522bdbd0bd4decf5f.gif

    I have attached a simple demo.

    Thank you for your time.

    #59183
    Support
    Keymaster

    Hi

    Thank you for the demo. I will check it and I hope to find a solution at the nearest few days.

    Another topic should be deleted, I think.

    #59206
    Support
    Keymaster

    Here is a changed program, look it please.

    Changed code was marked with “// Serge”

    #59218
    JM-DG
    Participant
    'Support' wrote:

    Here is a changed program, look it please.

    Changed code was marked with “// Serge”

    I see that you reset the wndproc after each “clear”.

    It seems that I also have to do a reset after having removed all items in the list using the remove button.

    I noticed that I don't need this reset after the list is emptied if I initialize my custom windowproc before adding items in the list in the FormCreate event.

    But when I try it in my real application the behavior changes. Even if I initialize my custom windowproc at the start, I have to do resets every clear.

    The behavior seem inconsistant as to why & when we're losing our custom wndproc.

    #59222
    Support
    Keymaster

    I will try to disable this code which recreates the control when “Clear” is called.

    New release with changes will be available soon.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.