If Screen.FromPoint(Me.Location).Primary Then
Get device name on which form is currently on :
Get Screen resolution of display, your form is currently on :
Dim rect As Rectangle = Screen.FromPoint(Me.Location).Bounds
A common problem while using webBrowser control is open pop up windows in instance of Internet Explorer and not in your application.
There’s a simple way to prevent this.
Logic is to capture the event when New Window is opened | Grab Link | Open it programatically in our application | cancel opening IE.
and code would be :
To add a BindingNavigator for a DataGridView, even when there’s no DataSource like DataSet or DataTable in use, you can have DataGridView’s rows collection as DataSource for BindingSource.
And set that BindingSource to BindingSource property of BindingNavigator.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
BindingSource2.DataSource = DataGridView1.Rows
BindingNavigator1.BindingSource = BindingSource2
'instead of adding event handler for MoveFirst,MoveLast,MoveNext,MovePrevious
'chose this one. it will fire anyway
AddHandler BindingNavigatorPositionItem.TextChanged, AddressOf bindingnavigator_PostionChanged
Adding directory structure to explorer form to use it like Windows Explorer:
Right click your project in Solution Explorer and click Add > Add New Item | Select Explorer Form from the list and Click ok, [keep default name if you dont know changing it in further code]
When new Form is added to your project, double click it and replace whole code with the following. Result of which will be like this-
Original Post by Martin Xie
Public Shared Function SetParent(ByVal instr As IntPtr, ByVal outstr As IntPtr) As IntPtr
Private Sub startProcess()
Dim p As Process
p = Process.Start("notepad.exe")