William Hindman
wdhindman at bellsouth.net
Fri Dec 23 14:30:07 CST 2005
...yada, yada, yada code boy :) ...been doing rounded, oval, and elliptical forms for years ...I'll take a look at your code though and see if there's anything worth changing my current default sfgui module for ...but rounded forms are hardly more than a toy ...what I want is to be able to take a graphic like the Texas Instruments logo and shape a form to fit its bounds ...that's a sight more complicated, eh :) William ----- Original Message ----- From: <DWUTKA at marlow.com> To: <accessd at databaseadvisors.com> Sent: Friday, December 23, 2005 2:08 PM Subject: Re: [AccessD] Hiding the Access Window WAS: access xp runtime > My my my William, maybe you should spend a little more time over here, > then > on OT! ;) > > http://databaseadvisors.com/mailman/htdig/accessd/2004-June/025236.html > > Susan and I also co-wrote an article on shaped forms. It's pretty simple > to > do. > > Here's some code you can drop in a form to make it 'rounded'. > CreateRoundRectRgn is the easiest to use if you aren't very artistic. : > > Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, > ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, > ByVal Y3 As Long) As Long > Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, > ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long > Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) > As > Long > Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" > (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As > Any) As Long > Private Declare Function ReleaseCapture Lib "user32" () As Long > Const intFrameWidth As Long = 350 > Const intFrameHeight As Long = 250 > Const intEllipseSize As Long = 70 > Const intBorderSize As Long = 40 > Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As > Single, Y As Single) > ReleaseCapture > SendMessage Me.hwnd, &HA1, 2, 0& > End Sub > Private Sub Form_Load() > Dim X As Long > X = SetThisWindowsRegion > SetMainWindowRegion X > DeleteObject X > End Sub > Private Function SetThisWindowsRegion() As Long > Dim intInsetFrame As Long > intInsetFrame = CreateRoundRectRgn(intBorderSize, intBorderSize, > intFrameWidth - intBorderSize, intFrameHeight - intBorderSize, > intEllipseSize, intEllipseSize) > SetThisWindowsRegion = intInsetFrame > End Function > Private Function SetMainWindowRegion(cRgn As Long) > Dim dwReturn As Long > dwReturn = SetWindowRgn(Me.hwnd, cRgn, True) > End Function > > Drew > -----Original Message----- > From: William Hindman [mailto:wdhindman at bellsouth.net] > Sent: Friday, December 23, 2005 12:30 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Hiding the Access Window WAS: access xp runtime > > > ...so far its a sin how well it works ...and so much for my christmas > weekend ...now I have to redo a major client app that I'd earlier > abandoned > this approach on ...but much appreciate the insight and code Drew :) > > ...so when you're really bored and need something to wile away your time > on, > > how about looking at making this all work with shaped forms ...or better > yet, fit a bitmap (or even better, a vector emf) ala Pedro Gil's code > ...now > > THAT would impress me! :) > > http://www.geocities.com/pmpg98_pt/ShapedForm.html > > William > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com >