babyfireflyx (rhiahnnon) wrote in vbdev,

In serious need of help :(

Hello..I just need some assistance regarding something that I'm trying to do.

I need to create a procedure called SetFont with 2 parameters: a label parameter and a string parameter. This procedure will recieve a label object and define the label's font settings. The string parameter will be 1 byte: H, N or R. Inside the procedure I need to use a Select Case statement that examines the string parameter and sets the fonts as shown below:

Heading(H) - Font Name (comic Sans MS); font size 14 bold - true, italic - false, foreColor - any colour

Normal (N) font name (comic sans MS), font size: 11, bold - false, italic - false, foreColor - any colour

Refund (R) fontname (Arial), fontsize - 9, bold - true, italic- true, forecolor - any colour

Inside the other procedure (DisplayTotal - don't worry about this) I need to call SetFont as appropriate...

I've tried to figure this out but I can't make any sense of it for the life of me. I need to do it for one of my classes..I'm such a n00b at this

Anyways, thank you for your time..
  • Post a new comment


    default userpic

    Your IP address will be recorded 

Sub SetFont(LBL As Label, Str As String)
Select Case Str
Case "H"
With LBL
.FontName = "Tahoma"
.FontSize = 14
.FontItalic = False
.ForeColor = vbYellow
End With
Case "N"
With LBL
.FontName = "Comic Sans MS"
.FontSize = 11
.FontItalic = False
.ForeColor = vbGreen
End With
Case "R"
With LBL
.FontName = "Arial"
.FontSize = 9
.FontItalic = True
.FontBold = True
.ForeColor = vbRed
End With
End Select
End Sub
Thank you so much for your help! I would have thanked you earlier but I haven't had internet access for a while :/