none
Table In VB RRS feed

  • Question

  • Hi, 

    I was wondering if there was a way to add table to the Form in Visual Basic, if so could you tell me the settings/code to do so?

    Thanks

    Friday, September 28, 2018 10:04 PM

Answers

  • Like a visual kind of table in The Form, So if I want to like surround like text boxes in like a 5 x 5 format

    Hi,

    use DataGridview

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            DataGridView1.RowHeadersVisible = False
    
            DataGridView1.ColumnHeadersVisible = False
            DataGridView1.Rows.Add("", "", "", "", "")
    
            DataGridView1.Rows.Add("", "", "", "", "")
    
            DataGridView1.Rows.Add("", "", "", "", "")
    
            DataGridView1.Rows.Add("", "", "", "", "")
    
            DataGridView1.Rows.Add("", "", "", "", "")
            DataGridView1.AllowUserToResizeRows = False
    
            DataGridView1.AllowUserToResizeColumns = False
        End Sub
    End Class
    

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Frozen_Nova Tuesday, October 2, 2018 1:04 AM
    Saturday, September 29, 2018 1:49 PM

All replies

  • What kind of table?

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by Frozen_Nova Saturday, September 29, 2018 1:51 AM
    • Unmarked as answer by Frozen_Nova Saturday, September 29, 2018 1:51 AM
    Friday, September 28, 2018 10:12 PM
    Moderator
  • Hi

    Dim MyTable As New DataTable("TableName")


    Regards Les, Livingston, Scotland


    • Edited by leshay Friday, September 28, 2018 11:24 PM typo
    Friday, September 28, 2018 10:56 PM
  • Like a visual kind of table in The Form, So if I want to like surround like text boxes in like a 5 x 5 format

    Saturday, September 29, 2018 1:51 AM
  • Hi

    Are you like maybe asking like something like a grid like of say 5 columns x 5 rows like?

    Or, like, if you want TextBoxes only like, then you can place them like a 5 x 5 grid on the designer like.

    Do you like actually have a version of VB like?


    Regards Les, Livingston, Scotland

    Saturday, September 29, 2018 2:09 AM
  • Like a visual kind of table in The Form, So if I want to like surround like text boxes in like a 5 x 5 format

    Use a TableLayoutPanel.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Saturday, September 29, 2018 2:12 AM
    Moderator
  • Like a visual kind of table in The Form, So if I want to like surround like text boxes in like a 5 x 5 format

    Hi,

    use DataGridview

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            DataGridView1.RowHeadersVisible = False
    
            DataGridView1.ColumnHeadersVisible = False
            DataGridView1.Rows.Add("", "", "", "", "")
    
            DataGridView1.Rows.Add("", "", "", "", "")
    
            DataGridView1.Rows.Add("", "", "", "", "")
    
            DataGridView1.Rows.Add("", "", "", "", "")
    
            DataGridView1.Rows.Add("", "", "", "", "")
            DataGridView1.AllowUserToResizeRows = False
    
            DataGridView1.AllowUserToResizeColumns = False
        End Sub
    End Class
    

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Frozen_Nova Tuesday, October 2, 2018 1:04 AM
    Saturday, September 29, 2018 1:49 PM