Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #1052

Re: VB6 Frames

From Deanna Earley <dee.earley@icode.co.uk>
Newsgroups comp.lang.basic.visual.misc
Subject Re: VB6 Frames
Date 2012-04-30 08:59 +0100
Organization Aioe.org NNTP Server
Message-ID <jnlgpe$o0f$1@speranza.aioe.org> (permalink)
References <535op7d1eqve0prjlcl8m73fl7finp8pgd@4ax.com> <XnsA043B1122B58Bauricauricauricauric@88.198.244.100> <371qp71hl0hbe2aej6h6hb588np6iduq9b@4ax.com>

Show all headers | View raw


On 29/04/2012 10:10, scbs29 wrote:
> On Sun, 29 Apr 2012 00:24:26 +0000 (UTC), "Auric__"
> <not.my.real@email.address>  wrote:
>
>> scbs29 wrote:
>>
>>> probably simple question
>>>
>>> I have image controls within frames. I calculate to fit the images to
>>> the frame dimensions, but if the frame has a borderstyle 1, fixed
>>> single, the images still extend to the frame edges. Is there a way of
>>> only extending the images to fit within the border ?
>>
>> Have you tried checking the border style when you load the image? Something
>> like this might work (if using a Picture control; Image controls don't
>> support the Change event so you'd have to run the sub from your code):
>>
>>   Const onepixel = 14
>>   Const twopixels = 28
>>
>>   Private Sub Picture1_Change()
>>     With Picture1
>>       If Frame1.BorderStyle And (Len(.Tag)<  1) Then
>>         .Tag = "moved"
>>         .Left = .Left + onepixel
>>         .Top = .Top + onepixel
>>         .Width = .Width - twopixels
>>         .Height = .Height - twopixels
>>       ElseIf Len(.Tag) And (0 = Frame1.BorderStyle) Then
>>         .Tag = ""
>>         .Left = .Left - onepixel
>>         .Top = .Top - onepixel
>>         .Width = .Width + twopixels
>>         .Height = .Height + twopixels
>>       End If
>>     End With
>>   End Sub
>
> Thanks for the reply.
> I have tried your suggestion, but had to multiply the const values by
> 10 to show any effect. If I have to set a particular value for these,
> however, then surely they will only work correctly at the screen
> resolution at which they are tested.

Use Screen.TwipsPerPixelX/Y as the multiplier.

-- 
Deanna Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

VB6 Frames scbs29 <scbs29@fred.talktalk.net> - 2012-04-28 17:12 +0100
  Re: VB6 Frames "Auric__" <not.my.real@email.address> - 2012-04-29 00:24 +0000
    Re: VB6 Frames scbs29 <scbs29@fred.talktalk.net> - 2012-04-29 10:10 +0100
      Re: VB6 Frames Deanna Earley <dee.earley@icode.co.uk> - 2012-04-30 08:59 +0100
  Re: VB6 Frames "Mike Williams" <Mike@WhiskyAndCoke.com> - 2012-04-29 13:18 +0100
    Re: VB6 Frames "Mike Williams" <Mike@WhiskyAndCoke.com> - 2012-04-30 11:25 +0100
  Re: VB6 Frames scbs29 <scbs29@fred.talktalk.net> - 2012-04-30 12:52 +0100
    Re: VB6 Frames "Mike Williams" <Mike@WhiskyAndCoke.com> - 2012-04-30 13:43 +0100
      Re: VB6 Frames scbs29 <scbs29@fred.talktalk.net> - 2012-05-02 13:39 +0100
        Re: VB6 Frames "Mike Williams" <Mike@WhiskyAndCoke.com> - 2012-05-02 21:21 +0100

csiph-web