Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe that the most efficient way is to use a <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.tablelayoutpanel.aspx" rel="nofollow">tableLayoutPanel</a> with 6 columns. Add in each cell a label showing in the first cell the number, in the second the indicator for that number (right/wrong). Do the same for second and third number.(second number = third and fourth cell, third number =fifth and sixth cell) </p> <p>For the next set of numbers you can add a new row with with labels in each cell. </p> <p>I'll add some code to make my answer more professional.</p> <p>First you add the tableLayoutPanel in your form. You size it as you like (make its width, long enough to handle the data) You delete the lastRow and then you add columns (you want to have 6 columns). You edit the size of the columns to be Percentage =16.67%</p> <pre><code>Public Class Form1 Private rowIndex Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load For i = 0 To 4 Step 2 Dim val As Integer = 3 AddLabels(val, i, 0) Next For i = 1 To 5 Step 2 Dim val As String = "right" AddLabels(val, i, 0) Next End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click rowIndex = rowIndex + 1 Me.TableLayoutPanel1.RowStyles.Add(New RowStyle(SizeType.Absolute, 30)) Me.TableLayoutPanel1.Height = Me.TableLayoutPanel1.Height + 30 For i = 0 To 4 Step 2 Dim val As Integer = 3 'here you have to put your number AddLabels(val, i, rowIndex) Next For i = 1 To 5 Step 2 Dim val As String = "right" 'here you have to put your indicator AddLabels(val, i, rowIndex) Next End Sub Private Sub AddLabels(ByVal lblValue As String, ByVal column As Integer, ByVal row As Integer) Dim lblHeader As New Label lblHeader.AutoSize = True lblHeader.Margin = New Padding(0) lblHeader.BackColor = Color.Transparent lblHeader.TextAlign = ContentAlignment.MiddleLeft lblHeader.Dock = DockStyle.None lblHeader.Text = lblValue 'Put the lblHeader in the right cell Dim lblHeaderPos As New TableLayoutPanelCellPosition(column, row) TableLayoutPanel1.SetCellPosition(lblHeader, lblHeaderPos) TableLayoutPanel1.Controls.Add(lblHeader) End Sub </code></pre> <p>Let me know if you facing any problems. </p> <p>Also if you don't know how many rows you will add, put the tableLyoutPanel inside a panel. Make the panel's property AutoScroll=True and then you can add infinite number of new rows.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload