Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

XP Style

Hey,

If we use XP as style for a button, the button shows strange behaviour.

In formdesigner we choose XP as Style in the "OLE Control Properties" window for the control "BUTTON_1"

In the create event we have:

ctrl = @window:'.BUTTON_1'
caption = fmt(time(),'MTS')
Set_property(ctrl,'Caption',caption)

You can see the time on the caption in runtime until you hoover over the button.

Regards
Ed Keeman

Comments

  • There is some weird interaction sometimes when setting properties that are supposed to redraw themselves during the CREATE event. So, you are setting the Caption property and internally the control is flagged for redraw, but the state of the form is preventing it. Hovering over the button finally triggers it.

    For this reason, we always make our forms invisible then make the visible at the end of the create event. Not only does this ensure everything redraws, it also removes flicker and speeds up form loading.

    If you are already doing this, then there is something else at play that I am currently unable to recreate.
  • Ed,

    Also try this thread. It might help shed some light on it and only occurred with buttons whose style was 'XP'

    https://forum.srpcs.com/discussion/111/drawing-issues-with-windows-7
Sign In or Register to comment.