I'm writing a Reference and Citation Builder based on the Harvard Method of Referencing, later I plan to incorporate Numerical method into it as well as being able to reference many kinds of source, possibly incorporating an ISBN Lookup and/or BarCode reader.
For now though, while my head isn't so far in the clouds, I've come across a problem that I can't figure out. (I'm using this bespoke project to teach me VB.NET).
I've manually concatenated various strings together to create the reference but the title needs to be in
BoldItalic. How would I change the font properties of the HVD_ARTICLE_TITLE string to reflect this?
i.e.
QUOTE
Bloggs, J. (2008) Need VB.NET Help England:Publishment INC
instead of
QUOTE
Bloggs, J. (2008) Need VB.NET Help England:Publishment INC
Here is my code at the moment:
vb
Private Sub btnHVDBuildRef_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHVDBuildRef.Click
HVD_ARTICLE_AUTHOR_SURNAME = txtHvdArticleAuthorSurname.Text
HVD_ARTICLE_AUTHOR_INITIAL = txtHvdArticleAuthorInitial.Text.ToUpper & _
txtHvdArticleAuthorInitial2.Text.ToUpper & _
txtHvdArticleAuthorInitial3.Text.ToUpper
HVD_ARTICLE_TITLE = txtHvdArticleTitle.Text
HVD_ARTICLE_DATE = txtHvdArticleDateYear.Text
HVD_ARTICLE_PLACE_OF_PUBLISHMENT = txtHvdPlaceOfPublishment.Text
HVD_ARTICLE_PUBLISHER = txtHvdPublisher.Text
OUTPUT_REFERENCE = HVD_ARTICLE_AUTHOR_SURNAME & ", " & HVD_ARTICLE_AUTHOR_INITIAL & ". (" & HVD_ARTICLE_DATE & ") " & HVD_ARTICLE_TITLE & " " & HVD_ARTICLE_PLACE_OF_PUBLISHMENT & ":" & HVD_ARTICLE_PUBLISHER
OUTPUT_CITATION = "(" & HVD_ARTICLE_AUTHOR_SURNAME & ", " & HVD_ARTICLE_DATE & ")"
Select Case ValidateReference()
Case True
txtRefOutput.Text = OUTPUT_REFERENCE
txtCiteOutput.Text = OUTPUT_CITATION
Case False
MsgBox("Could not build reference.", MsgBoxStyle.OkOnly, "Invalid Data Entry")
End Select
End Sub 'Build Reference Button'
Private Function ValidateReference() As Boolean
If HVD_ARTICLE_AUTHOR_SURNAME = "" Or HVD_ARTICLE_AUTHOR_INITIAL = "" Or HVD_ARTICLE_DATE = "" Or HVD_ARTICLE_TITLE = "" Or HVD_ARTICLE_PLACE_OF_PUBLISHMENT = "" Or HVD_ARTICLE_PUBLISHER = "" Then
MsgBox("One or more fields are empty, please check and try again.", MsgBoxStyle.OkOnly, "Invalid Data Entry")
Return False
Else
Return True
End If
End Function
And my variables...
vb
'The Big List Of Variables'
'~~~~~~~~~~~~~~~~~~~~~~~~~'
'Global Variables'
Dim BR As String = Chr((13) & (10))
'Reference Variables'
Dim REFERENCE_METHOD As String
Dim REFERENCE_SOURCE As String
Dim OUTPUT_REFERENCE As String
Dim OUTPUT_CITATION As String
Dim VALID_REFERENCE As Boolean
Dim NUM_REFERENCE_NUMBER As Integer
'Harvard Specific Variables'
Dim _
HVD_ARTICLE_AUTHOR_SURNAME, _
HVD_ARTICLE_AUTHOR_INITIAL, _
HVD_ARTICLE_CO_AUTHOR_NAME, _
HVD_ARTICLE_CO_AUTHOR_INITIAL, _
HVD_ARTICLE_DATE, _
HVD_ARTICLE_TITLE, _
HVD_ARTICLE_PAGE, _
HVD_ARTICLE_PLACE_OF_PUBLISHMENT, _
HVD_ARTICLE_PUBLISHER, _
HVD_NEWSPAPER_NAME, _
HVD_WEBSITE_URL, _
HVD_DATE_ACCESSED, _
HVD_DATE_UPDATED, _
HVD_INTERVIEWER _
As String
Also is it better to declare variables in singular (Like the reference variable strings) or in block (Like the Harvard strings)?
Cheers in advance.
--EDIT--
NB: All txtNames are RichTextBox Elements rather than TextBox Elements, I know they should be rtfNames, I'll go back and change them later on.
This post has been edited by Apache: 3 Nov, 2008 - 08:45 PM