To open a new window in vb by clicking a button replacing the previus windw
You can't (easily) replace it, but you can hide the current window and call tne new window's ShowDialog().
First, you have to unload or hide the current window (where you will click the button) then show the window that you want to show using it's name.
On the button which will show the next form.
Private Sub Command1_Click() Me.Hide Form2.Show() End Sub
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Hide() // this will hide the window where this code is entered Form2.Show() //this will display the other window, Form2 is the name,replace it with yours, you can also use Form2.ShowDialog() End Sub End Class
Haven't tried VB 2010. :-)
got it . thanks :)
just a small corection .
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim A as Form2() // make the new form to a variable Me.Hide() // this will hide the window where this code is entered A.Show() //this will display the other window, Form2 is the name,replace it with yours, you can also use Form2.ShowDialog() End Sub End Class
It seems you were looking for vb.net code, which is a different forum from vb6. :) Irrespective, it seems that your problem was solved, please mark as such, thanx.
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.
This is the result of previous question answered :
code for the listbox - datagridview interaction
At the top of the code ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...