none
Form region preview pane - custom control refresh/redraw issue RRS feed

  • Question

  • Hi All,

    I have a custom preview pane (replace all) form region. Inside of that form region I have a couple of custom rich edit controls (OCX’s), along with many other custom controls. The form region displays mail items and has a lot of customization. Everything behaves wonderfully except for one issue, that being when the custom rich edit control is populated with email addresses during the BeforeFormRegionShow event. That logic works but has a focus/activation issue where the content of the rich edit control does not become visible until the preview pane mail item is selected.

    When I select mail items individually, all email addresses in the rich edit control will display perfectly. The one issue that I have not been able to solve is when I select a different folder. When I select a new folder, the rich edit control does not display the content until I click on the control, or I select the item within the folder (mouse click).

    By design, when the user switches folders, the pane with the folders becomes active. So, therefore, the selected item is not active which I believe is the problem.

    Some items I have tried

    1. SetFocus or active the control. Tried posting a message and delaying after the form region show event.
    2. Tried to hide and show the window of the control.
    3. Captured Explorer Folder Switch event and tried to active the selected item.

    I think the problem is the form has not finished loading and no matter what I do it is too early in the process. I think the preview window is still loading and I am doing things too early.

    So I am looking for a way to activate the preview window during a folder switch event (Explorer Event). I think If I could activate the selected mail item the control would repaint.

    Does anybody have any suggestions?

    Thanks,

    Tom

    Tuesday, June 26, 2018 9:50 PM

Answers

  • I have created a fix that seems to work.

    I created a method in the OCX control that starts a timer. I call this method after the folder is switched and set a timer. After the timer elapses I call refresh, and then kill the timer.

    It is not elegant, but it seems to work and gets me to where I want to go.

    It would be nice if the form had a event like window.onload.

    • Proposed as answer by Terry Xu - MSFT Thursday, June 28, 2018 9:20 AM
    • Marked as answer by Thomas Lee3 Thursday, June 28, 2018 11:10 AM
    Wednesday, June 27, 2018 10:11 PM

All replies

  • I have created a fix that seems to work.

    I created a method in the OCX control that starts a timer. I call this method after the folder is switched and set a timer. After the timer elapses I call refresh, and then kill the timer.

    It is not elegant, but it seems to work and gets me to where I want to go.

    It would be nice if the form had a event like window.onload.

    • Proposed as answer by Terry Xu - MSFT Thursday, June 28, 2018 9:20 AM
    • Marked as answer by Thomas Lee3 Thursday, June 28, 2018 11:10 AM
    Wednesday, June 27, 2018 10:11 PM
  • Hello Tomas,

    Glad to hear that your issue has been resolved. I would suggest you mark your solution as answer to help other developers who run into the same issue could find the solution efficient. If you have any other new issue, please feel free to post threads to let us know.

    Best Regards,

    Terry


    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.

    Thursday, June 28, 2018 9:25 AM