* " active" <(E-Mail Removed)> scripsit:
> A few questions about the FontDialog and dealing with Fonts
>
> Is it necessary to pass the parameters ByRef so that updated values can be
> returned.?
>
> I wouldn't think it is necessary for the font but is required for the color.
> Is that correct??
>
> Private Sub DialogSetFontVariable(ByRef acolor As Drawing.Color, ByRef
> audtFontVariable As Font)
'Color' is a value type, so you will have to pass it 'ByRef', 'Font' is
a reference type, you want to allow the procedure to change this
reference, so pass it 'ByRef' too.
> Dim FontDialog1 As New FontDialog
>
> FontDialog1.Font = audtFontVariable ????Does this mean changes made by the
> dialog are made to audtFontVariable????
Why not test it on your own?
> FontDialog1.ShowColor = True
>
> FontDialog1.Color = acolor
>
> If FontDialog1.ShowDialog() <> DialogResult.Cancel Then
>
> audtFontVariable = FontDialog1.Font.Clone ????Is this needed to update
> audtFontVariable????Is clone necessary??
Yes. Doesn't it work if you skip the 'Clone'?
> acolor = FontDialog1.Color ????Is this needed to update aColor????
Yes.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
|