Hey everybody...just started porting all our programs to VB.NET and love the language but miss some of the straightforward ways of doing things in good old VB6.
Here is the situation (oversimplified but you get my point).
I have one main form with a command button
Clicking the command button fires the code to bring up a clients purchase order.
VB Code:
Dim frm As New frmShowPurchaseOrder() frm.WindowState = FormWindowState.Normal frm.Show()
This form has a button that, when clicked, fires the code to bring up a listing of products.
VB Code:
Dim frm As New frmShowProducts() frm.WindowState = FormWindowState.Normal frm.Show()
The user then selects a product and hits submit. The product is added to the purchase order (through sql server SP's), and the form is closed.
The problem lies in that i don't know how to set focus back to the PurchaseOrder form in order to tell itto refresh the datagrid that holds all products.
At this point i am using
VB Code:
Private Sub frmShowPurchaseOrder_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove If g_intFormMaterialActivate >= 1 Then Else MsgBox("I am activated") UpdateMaterialDataGrid() 'so they only fire it once g_intFormMaterialActivate += 1 End If End Sub
To fire the UpdateProductDataGrid() function call but it means that the user has to move the mouse and i want it to happen automatically.
How can i do this once the form has focus?
Sorry this has been so longwinded but i hate questions that are asked with too little detail.
(although this may stretch the bounds).
Thanks in advance!!
![]()




).
Reply With Quote