How to show data of DataGridView in User Control ? (When i clicked a strip menu.) VB.Net in Visual Studio 2010

ฟฟฟฟฟ หหหหห 21 Reputation points
2021-09-22T10:48:02.59+00:00

Hello Everyone
I saw this community in Google, and i am newbie.

When i create my project, and i found a problem.
1.I created the main form, strip menu and Panel.
134303-image.png
134269-image.png

2.I created the user control and data grid view.
3.When i click menu then user control shows and i want to show data of data grid view also, what should I do?
134304-image.png

Developer technologies VB
0 comments No comments
{count} votes

Accepted answer
  1. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2021-09-22T19:56:48.74+00:00

    A better method rather than a user control is to place a TabControl on your form, add a tab for each operation then place controls on each Tab.

    To make the TabControl not appear as a TabControl

    Set the following properties

    • Appearance = TabAppearance.FlatButtons
    • ItemSize = new Size(0, 1)
    • SizeMode = TabSizeMode.Fixed

    If afterwards you need to modify one or more tables you need to revert ItemSize and SizeMode, when done reset those properties

    In menu selections, set the SelectedTab to the appropriate tab

    To set a tab TabControl1.SelectedTab = InventoryEditTab

    Off topic, be careful with TableAdapter component as they are generally used by new developers and those new developers get into trouble down the road if they don't fully understand them.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.