Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Here i have attached form window.I wanted to update form with relative data How to refresh the single form.

When New project detail is clicked from loaded with project data , when panel button clicked form loaded with panel data.

1)I tried this method. I created a group box for indivual button ,Show & hide when particular button being pressed. for example below . When new button pressed only display groupBox_new, Or any other method available.

VB
Private Sub Button_New_Click(sender As Object, e As EventArgs) Handles Button_New.Click

  GroupBox_New.Show()
  GroupBox_Panel.Hide()
  GroupBox_inverter.hide()
so  on.......

   End Sub


2) If you have checked my form i created groupbox called groupbox review. I want to update as soon as data entered in project data. I pasted my full code below. I found data is not refreshed but when choose next button and come to new option again it got populated. How can i make populate instantly.

My code look like this.

VB
Public Class Form1

    Dim counter As Integer

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'ProjectDataSet.Project_Table' table. You can move, or remove it, as needed.
        Me.Project_TableTableAdapter.Fill(Me.ProjectDataSet.Project_Table)
        Static counter = 0
    End Sub

    Private Sub NewProjectToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NewProjectToolStripMenuItem.Click

    End Sub


    Private Sub Button_pre_Click(sender As Object, e As EventArgs) Handles Button_pre.Click

        counter = counter - 1
        If counter = 0 Then
            Home_function()


        End If
        If counter = -1 Then
            Home_function()
            GroupBox_Project_Navigation.Refresh()
        End If
        If counter = 1 Then
            Home_function()
            GroupBox_Project_Navigation.Refresh()
        End If
        If counter = 2 Then
            New_function()
            Project_GropData()
        End If
        If counter = 3 Then
            SysType_function()

        End If

        If counter = 4 Then
            Panel_function()
        End If

        If counter = 5 Then
            Inverter_function()
        End If

        If counter = 6 Then
            Cable_function()
        End If

        If counter = 7 Then
            CktDiag_function()
        End If

        If counter = 8 Then
            BusBar_function()
        End If
        If counter = 9 Then
            Battery_function()
        End If
        If counter = 10 Then
            Calculate_function()
        End If
        If counter = 11 Then
            Curves_function()
        End If

        If counter > 11 Then
            counter = 0
        End If

    End Sub

    Private Sub Button_next_Click(sender As Object, e As EventArgs) Handles Button_next.Click

        counter = counter + 1
        If counter = 1 Then
            Home_function()
        End If
        If counter = 2 Then
            New_function()
        End If

        If counter = 3 Then
            SysType_function()
        End If
        If counter = 4 Then
            Panel_function()
        End If

        If counter = 5 Then
            Inverter_function()
        End If
        If counter = 6 Then
            Cable_function()
        End If

        If counter = 7 Then
            CktDiag_function()
        End If

        If counter = 8 Then
            BusBar_function()
        End If
        If counter = 9 Then
            Battery_function()
        End If
        If counter = 10 Then
            Calculate_function()
        End If
        If counter = 11 Then
            Curves_function()
        End If

        If counter > 11 Then
            counter = 0
        End If
    End Sub

  Private Function New_function()
        Button_Home.ForeColor = Color.Black
        Button_New.ForeColor = Color.Blue
        Button_Systype.ForeColor = Color.Black
        Button_Panel.ForeColor = Color.Black
        Button_Inverter.ForeColor = Color.Black
        Button_Cable.ForeColor = Color.Black
        Button_Ckt.ForeColor = Color.Black
        Button_Busbar.ForeColor = Color.Black
        Button_battery.ForeColor = Color.Black
        Button_Calc.ForeColor = Color.Black
        Button_Curves.ForeColor = Color.Black

        GroupBox_New.Show()


        Return (0)
    End Function
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900