Click here to Skip to main content
15,917,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to get available gmail/yahoo.mail account automatically by C# Pin
ndkit18-Nov-11 1:23
ndkit18-Nov-11 1:23 
GeneralRe: How to get available gmail/yahoo.mail account automatically by C# Pin
Bernhard Hiller18-Nov-11 1:38
Bernhard Hiller18-Nov-11 1:38 
AnswerRe: How to get available gmail/yahoo.mail account automatically by C# Pin
Richard MacCutchan17-Nov-11 7:03
mveRichard MacCutchan17-Nov-11 7:03 
AnswerRe: How to get available gmail/yahoo.mail account automatically by C# Pin
Luc Pattyn17-Nov-11 7:33
sitebuilderLuc Pattyn17-Nov-11 7:33 
QuestionWhirlpool Hash Algorithm. Pin
Ratika Agarwal17-Nov-11 2:55
Ratika Agarwal17-Nov-11 2:55 
AnswerRe: Whirlpool Hash Algorithm. Pin
JF201517-Nov-11 3:00
JF201517-Nov-11 3:00 
GeneralRe: Whirlpool Hash Algorithm. Pin
Ratika Agarwal2-Jan-12 8:07
Ratika Agarwal2-Jan-12 8:07 
QuestionGDI+ draw text in custom control question (is this the right approach?) Pin
Blubbo17-Nov-11 2:02
Blubbo17-Nov-11 2:02 
I've developed the other way to create the displaying of text by using GDI+ method in custom control. The problem is that I'm trying to determine if I am doing the right approach, escpecially be able to read the text clearly. I'm not sure about this individual byte to be drawn and assign their drawing location on the control.

The requirement I've got are:
1) multi-colored text
2) capability of changing background (no problem with this one)
3) needs to be monospaced (each characters have evenly spaced and all lined up
4) will consist of 16x16 grid (set up in an array of custom control in main form)
5) be able to bold the partial text (will work on that part later)

Here's the code I've done so far:

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CrumTypeInterface
{
    public partial class GraphicalTextBox : UserControl
    {
        byte[] byteToDisplay;
        SolidBrush[] solidbrushColorsToDisplay;
        Font fontNameToDisplay;

        public GraphicalTextBox()
        {
            InitializeComponent();
            this.Size = new Size(56, 25);
            this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        }

        private void GraphicalTextBox_Paint(object sender, PaintEventArgs e)
        {
            System.Drawing.Graphics formGraphics = this.CreateGraphics();
            System.Drawing.Font drawFont = new System.Drawing.Font("Verdana", 7);

            if (byteToDisplay != null)
            {
                formGraphics.DrawString(byteToDisplay[0].ToString("X2"), drawFont, solidbrushColorsToDisplay[0], 0, 4);
                formGraphics.DrawString(byteToDisplay[1].ToString("X2"), drawFont, solidbrushColorsToDisplay[1], 12, 4);
                formGraphics.DrawString(byteToDisplay[2].ToString("X2"), drawFont, solidbrushColorsToDisplay[2], 24, 4);
                formGraphics.DrawString(byteToDisplay[3].ToString("X2"), drawFont, solidbrushColorsToDisplay[3], 36, 4);
            }
            
            drawFont.Dispose();
            formGraphics.Dispose();
        }

        public void SetTextValue(byte[] byteValues, SolidBrush[] solidbrushColor, Font fontName)
        {
            byteToDisplay = byteValues;
            solidbrushColorsToDisplay = solidbrushColor;
            fontNameToDisplay = fontName;
            Refresh();
        }

        public void SetTextValue(byte[] byteValues, SolidBrush[] solidbrushColor)
        {
            byteToDisplay = byteValues;
            solidbrushColorsToDisplay = solidbrushColor;
            Refresh();
        }
    }
}

AnswerRe: GDI+ draw text in custom control question (is this the right approach?) Pin
Luc Pattyn17-Nov-11 2:26
sitebuilderLuc Pattyn17-Nov-11 2:26 
GeneralRe: GDI+ draw text in custom control question (is this the right approach?) Pin
Blubbo17-Nov-11 3:22
Blubbo17-Nov-11 3:22 
GeneralRe: GDI+ draw text in custom control question (is this the right approach?) Pin
Blubbo17-Nov-11 3:39
Blubbo17-Nov-11 3:39 
GeneralRe: GDI+ draw text in custom control question (is this the right approach?) Pin
Pete O'Hanlon17-Nov-11 4:02
mvePete O'Hanlon17-Nov-11 4:02 
AnswerRe: GDI+ draw text in custom control question (is this the right approach?) Pin
Luc Pattyn17-Nov-11 4:21
sitebuilderLuc Pattyn17-Nov-11 4:21 
QuestionHow to pass non-remotable objects through AddIn-Pipeline?! Pin
dreiundzwanzig16-Nov-11 23:12
dreiundzwanzig16-Nov-11 23:12 
AnswerRe: How to pass non-remotable objects through AddIn-Pipeline?! Pin
BobJanova17-Nov-11 23:41
BobJanova17-Nov-11 23:41 
General[closed] Re: How to pass non-remotable objects through AddIn-Pipeline?! Pin
dreiundzwanzig21-Nov-11 4:31
dreiundzwanzig21-Nov-11 4:31 
QuestionSpecify order in Type.GetMembers() Pin
AmitDey16-Nov-11 22:32
AmitDey16-Nov-11 22:32 
AnswerRe: Specify order in Type.GetMembers() Pin
Pete O'Hanlon16-Nov-11 22:47
mvePete O'Hanlon16-Nov-11 22:47 
GeneralRe: Specify order in Type.GetMembers() Pin
AmitDey16-Nov-11 22:51
AmitDey16-Nov-11 22:51 
GeneralRe: Specify order in Type.GetMembers() Pin
Pete O'Hanlon16-Nov-11 22:55
mvePete O'Hanlon16-Nov-11 22:55 
AnswerRe: Specify order in Type.GetMembers() Pin
BobJanova16-Nov-11 23:07
BobJanova16-Nov-11 23:07 
AnswerRe: Specify order in Type.GetMembers() Pin
BillWoodruff16-Nov-11 23:11
professionalBillWoodruff16-Nov-11 23:11 
QuestionRe: Specify order in Type.GetMembers() Pin
Rob Philpott17-Nov-11 1:23
Rob Philpott17-Nov-11 1:23 
Questionto develop web based helpdesk application (visual studio 2005) Pin
sk_ko16-Nov-11 21:28
sk_ko16-Nov-11 21:28 
AnswerRe: to develop web based helpdesk application (visual studio 2005) Pin
Richard MacCutchan16-Nov-11 21:47
mveRichard MacCutchan16-Nov-11 21:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.