hi,
First off all i draw a rectangle in a avax-component. Then when i select it, it draws a rectangular box around it , wich makes it posible to resize the rectangle. But thats just what i'am trying to prevent. So the user can move the rectangle around, but is not alowed to resize it. Can i set somekind off propety to prevent this ?
Thank you very much for your reply.
Greetings From Holland,
Martijn Huinink.
Page 1 of 1
Selecting Object, no resize
#2
Posted 02 October 2007 - 09:16 AM
Here it is an example written in VB6 on how to handle the stretch and move behavior of an object.
Option Explicit Dim h As Long Private Sub cAvax1_SelectRegionStretch(StretchHandles() As Long, xOldMin As Single, yOldMin As Single, xOldMax As Single, yOldMax As Single, xNewMin As Single, yNewMin As Single, xNewMax As Single, yNewMax As Single, fCancel As Boolean) Dim lCnt As Long, lMax As Long Const NumDigitsAfterDecimal As Long = 5 If Round(Abs(xOldMax - xOldMin), NumDigitsAfterDecimal) = Round(Abs(xNewMax - xNewMin), NumDigitsAfterDecimal) And Round(Abs(yOldMax - yOldMin), NumDigitsAfterDecimal) = Round(Abs(yNewMax - yNewMin), NumDigitsAfterDecimal) Then 'Moving objects Exit Sub End If lMax = UBound(StretchHandles()) For lCnt = 1 To lMax If StretchHandles(lCnt) = h Then fCancel = True Exit Sub End If Next lCnt End Sub Private Sub Form_Load() Call cAvax1.StartAvax h = cAvax1.Add_Rectangle(0, 0, 10, 10, , cAvax1.NearestPaletteIndexColor(vbRed)) 'Not free to stretch Call cAvax1.Add_Rectangle(15, 0, 10, 10, , cAvax1.NearestPaletteIndexColor(vbGreen)) 'Free to stretch End Sub Private Sub Form_Unload(Cancel As Integer) Call cAvax1.EndAvax End Sub
Athanasios Gardos
Avax-Software.com
Avax-Software.com
Page 1 of 1
Sign In
Register
Help
Add Reply
MultiQuote