Click here to Skip to main content
13,193,590 members (51,004 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi, I am making an APA web based citation generator. All is well but I seem to be having trouble making a string have an Italic font, Here is my code.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
    public partial class Form1 : Form
        public Form1()
        string author;
        string date;
        string TitleOfArticle;
        string Retriveddate;
        string websiteURl;
        string citation;
        private void Form1_Load(object sender, EventArgs e)
        private void button1_Click(object sender, EventArgs e)
            //issues: make the richtextbox display title as italic.
            author = AuthorBox.Text;
            date = PublishBox.Text;
            TitleOfArticle = TitleBox.Text;
            Retriveddate = RetrivedBox.Text;
            websiteURl = URLBox.Text;
            citation = author + " ." + "(" + date + "). " + TitleOfArticle + ". Retrieved " + Retriveddate + ", from " + websiteURl;
            richTextBox1.Text = citation;
        private void button3_Click(object sender, EventArgs e)
        private void button2_Click(object sender, EventArgs e)

As you can see in my sample code I have strings for each combobox and they record the user's input for each box. Then I combine all of them and put it into 1 string called "Citation" and when the user presses a button this string is displayed in a richtextbox. In a proper web citation for APA the title of the webpage needs to be Italic. How can I change the font style of the title and make it Italic when the user generates the citation? The string for the title of webpage is called "TitleOfArticle".

I appreciate everyones help.

Posted 6-Aug-12 20:14pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need to change the box's font style.[^] might help.

how to change a textbox text to bold,italic in C# windows application[^] is for a normal textbox, but might give you an idea as well.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Hey Abhinav S, I found what I was looking for thanks for your help. I came across this post on "StackOverFlow" heres the link. You can find the solution from the user called "PsychoDad"[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171018.2 | Last Updated 7 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100