AccessBlog.net

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Alex
Name:Alex Dybenko

Location:Moscow, Russia

Thursday, March 31, 2011

How to redraw Access form on RDC session

I recently moved one of my applications to terminal services hosting. In most case this works just fine, but in this application I use DBPix ActiveX control with pop-up form (red ring) over it, movable by user:

image

This combination produced very weird visual effects on terminal server session, basically control area was not repainted correctly. I tried to send WM_PAINT message, InvalidateRect function, nothing helped. So I ended up with following solution: after form load and after event of moving popup form I run .Move form method to move form one pixel left and then back.

If IsRunningInTerminal() Then
       Me.Move Me.WindowLeft + 8
       Me.Move Me.WindowLeft – 8
End If

Not very elegant solution, but it works. And if you know better solution – please post comment here.

By the way, Ammara developing new DBpix 3.0 version with some exciting features!

Labels: ,

5 Comments:

Blogger grovelli said...

I've found this http://www.access-programmers.co.uk/forums/showthread.php?t=134027 but it doesn't seem to do what you show and in any case it's all part of an Access mdb. In the picture you show, the red ring is a pop-up Access form but the drawing of a a house underneath it is still in the same mdb or not?

11:55 AM  
Blogger Alex Dybenko said...

Ciao Girgio,
i will make a new post on transparent forms.

12:16 PM  
Blogger grovelli said...

Ok. What are WM_PAINT message and InvalidateRect function?

1:10 AM  
Blogger Alex Dybenko said...

easy to find:
http://msdn.microsoft.com/en-us/library/dd145213(v=vs.85).aspx

10:09 AM  
Anonymous David said...

Such a great article which this combination produced very weird visual effects on terminal server session, basically control area was not repainted correctly.Trying to send WM_PAINT message, InvalidateRect function, nothing helped. Thanks for sharing this article.

1:20 PM  

Post a Comment

<< Home