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


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

Re: User Control Font Object

From "Mike Williams" <Mike@WhiskyAndCoke.com>
Newsgroups comp.lang.basic.visual.misc, microsoft.public.vb.general.discussion
Subject Re: User Control Font Object
Date 2011-08-18 00:22 +0100
Organization A noiseless patient Spider
Message-ID <j2hie5$e3o$1@dont-email.me> (permalink)
References <j2h6hi$smr$1@dont-email.me> <j2h8q7$i6v$1@speranza.aioe.org>

Cross-posted to 2 groups.

Show all headers | View raw


"Nobody" <nobody@nobody.com> wrote in message 
news:j2h8q7$i6v$1@speranza.aioe.org...
> "Mike Williams" <Mike@WhiskyAndCoke.com> wrote in message
>> I've been following the procedure outlined at the following MSDN page:
>> http://msdn.microsoft.com/en-us/library/aa261313(v=vs.60).aspx
>> The code works in that if you drop such a User Control on a Form
>> and select it you can see the Font in its Properties and you can set
>> it fine <smip> However, when you then run the program the font on
>> the User Control  reverts to its default setting. I'm obviously doing
>> something wrong and I wonder if anyone knows how to solve this
>
> You need to supply these events: UserControl_InitProperties
> UserControl_ReadProperties
> UserControl_WriteProperties
> There is an easy way to do that without writing code. Use "VB6
> ActiveX Ctrl Interface Wizard" Add-in, which generates the code
> for you . . . . .

Thanks Nobody. I didn't know about that wizard. I've just tried it now and 
unfortunately it does not solve my problem. It generates code very similar 
to the code I was already using (I left out a couple of Subs in my original 
post for brevity and because nothing I placed in there solved the problem). 
Basically it behaved in the same way as my existing code, losing the details 
of any font that may have been selected in the IDE when the project was run. 
Try it and you'll see. In the end it was Karl's suggestion of using the User 
Control's Ambient property which solved the problem. I'm very grateful to 
you for responding though, and of course to Karl for providing the solution. 
Thanks a lot to both of you. I've learnt something very useful today ;-)

Mike

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


Thread

User Control Font Object "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-08-17 20:06 +0100
  Re: User Control Font Object "Nobody" <nobody@nobody.com> - 2011-08-17 16:37 -0400
    Re: User Control Font Object "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-08-18 00:22 +0100
  Re: User Control Font Object Karl E. Peterson <karl@exmvps.org> - 2011-08-17 13:59 -0700
    Re: User Control Font Object "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-08-17 22:36 +0100
      Re: User Control Font Object Karl E. Peterson <karl@exmvps.org> - 2011-08-17 15:00 -0700

csiph-web