Click here to Skip to main content
15,919,245 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Asking advice for IO.File.ReadAllLines Pin
PIEBALDconsult17-May-15 7:07
mvePIEBALDconsult17-May-15 7:07 
GeneralRe: Asking advice for IO.File.ReadAllLines Pin
LA8888817-May-15 7:15
LA8888817-May-15 7:15 
Question[help] vb.net image resizing in picturebox Pin
Member 1169441315-May-15 15:19
Member 1169441315-May-15 15:19 
AnswerRe: [help] vb.net image resizing in picturebox Pin
Eddy Vluggen16-May-15 23:53
professionalEddy Vluggen16-May-15 23:53 
GeneralRe: [help] vb.net image resizing in picturebox Pin
Richard Andrew x6417-May-15 5:29
professionalRichard Andrew x6417-May-15 5:29 
GeneralRe: [help] vb.net image resizing in picturebox Pin
Eddy Vluggen17-May-15 6:36
professionalEddy Vluggen17-May-15 6:36 
QuestionCell painting in datagridview Pin
Helium9913-May-15 16:19
Helium9913-May-15 16:19 
AnswerRe: Cell painting in datagridview Pin
Eddy Vluggen15-May-15 6:26
professionalEddy Vluggen15-May-15 6:26 
You don't need to create a custom cell or column. You'd need a DGV (with data!) and to implement one of the paint-handlers;
C#
class Program
{
    static void Main(string[] args)
    {
        using (var f = new Form())
        {
            var dgv = new DataGridView() { Dock = DockStyle.Fill };
            dgv.Columns.Add(new DataGridViewTextBoxColumn());
            dgv.CellPainting += dgv_CellPainting;
            for (int i = 0; i < 5; i++)
                dgv.Rows.Add(new[] { Guid.NewGuid().ToString() });
            f.Controls.Add(dgv);
            f.ShowDialog();
        }
    }

    static readonly Size rectSize = new Size(10, 10);

    static void dgv_CellPainting(
        object sender,
        DataGridViewCellPaintingEventArgs e)
    {
        e.Handled = false;

        if (0 == e.ColumnIndex)
        {
            if (-1 == e.RowIndex)
                return; // don't paint the title as if it were data

            e.PaintBackground(
                e.CellBounds,
                DataGridViewElementStates.Selected == e.State);

            e.PaintContent(e.ClipBounds);

            e.Graphics.FillRectangle(
                Brushes.Red,
                new Rectangle(e.CellBounds.Location, rectSize));

            e.Handled = true;
        }
    }
}
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: Cell painting in datagridview Pin
Helium9916-May-15 13:17
Helium9916-May-15 13:17 
GeneralRe: Cell painting in datagridview Pin
Eddy Vluggen16-May-15 23:50
professionalEddy Vluggen16-May-15 23:50 
GeneralRe: Cell painting in datagridview Pin
Helium9917-May-15 14:03
Helium9917-May-15 14:03 
GeneralRe: Cell painting in datagridview Pin
Eddy Vluggen18-May-15 2:43
professionalEddy Vluggen18-May-15 2:43 
Questiongrouping is not working Pin
hussain54813-May-15 6:30
hussain54813-May-15 6:30 
AnswerRe: grouping is not working Pin
Dave Kreskowiak13-May-15 14:43
mveDave Kreskowiak13-May-15 14:43 
Question[RESOLVED] Can a COM port be reached by it's name or GUID Class ID instead of the COM Port name? Pin
SepPax13-May-15 1:12
SepPax13-May-15 1:12 
AnswerRe: Can a COM port be reached by it's name or GUID Class ID instead of the COM Port name? Pin
Richard Andrew x6413-May-15 5:48
professionalRichard Andrew x6413-May-15 5:48 
GeneralRe: Can a COM port be reached by it's name or GUID Class ID instead of the COM Port name? Pin
SepPax13-May-15 10:28
SepPax13-May-15 10:28 
GeneralRe: Can a COM port be reached by it's name or GUID Class ID instead of the COM Port name? Pin
Tim Carmichael14-May-15 2:34
Tim Carmichael14-May-15 2:34 
Answer[Resolved] Can a COM port be reached by it's name or GUID Class ID instead of the COM Port name? Pin
SepPax16-May-15 5:52
SepPax16-May-15 5:52 
QuestionDataGridView selection and focus Pin
Kenny-A11-May-15 11:34
Kenny-A11-May-15 11:34 
QuestionSerial data receive routing Pin
SepPax11-May-15 7:18
SepPax11-May-15 7:18 
AnswerRe: Serial data receive routing Pin
Richard MacCutchan11-May-15 7:38
mveRichard MacCutchan11-May-15 7:38 
GeneralRe: Serial data receive routing Pin
SepPax11-May-15 10:07
SepPax11-May-15 10:07 
GeneralRe: Serial data receive routing Pin
Sascha Lefèvre11-May-15 10:24
professionalSascha Lefèvre11-May-15 10:24 
GeneralRe: Serial data receive routing Pin
SepPax11-May-15 20:42
SepPax11-May-15 20:42 

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.