Windows forms focus

rongrace

Member
Joined
Jul 2, 2012
Messages
23
Programming Experience
Beginner
Hi guys,

I'm pretty new to visual studio and I have a problem that I can't seem to resolve.
I created a simple form that has a toolstrip at the top of the form which accepts a parameter from the user. It then uses this parameter to populate a number of text fields on the form.
My problem is that when the form loads the focus is in the first text field on the form where as I want the focus to be in the toolstrip that is requesting the user to enter data. I've tried to do this with

Private Sub frmQuoteHead_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
QuoteNoToolStripTextBox.Focus()
End Sub

But this doesn't work, what am I missing
 
I've eventually managed to upgrade and am now working with 2008, and the Focus command now works. Is this type of problem a regular occurrence between versions of Visual Studio.

Many thanks for all your help and suggestions
 
The leap from 2005 to 2008 is a particularly big one as it saw the end of VB6 and the full adoption of VB.Net which is a very different kettle of fish in concept. Working with 2005 very much belongs to a different era!
 
This surprises me, because winforms did not change between VB 2005 and VB 2008, they both use the same .Net 2.0 System.Windows.Forms assembly and CLR. With VB 2010 (VB10) there could technically be a difference, System.Windows.Forms assembly was recompiled to .Net 4 CLR, with only a handful of changes listed.

@Dunfiddlin, VB6 is not related to this, that was the VB version prior to .Net, see Visual Basic .NET - Wikipedia, the free encyclopedia
 
No I wasn't suggesting that VB6 was the same as 2005. But the .Net framework did develop considerably over these 3 years even if it's not immediately obvious and VB6 was basically ditched altogether in 2008 (the year, not the version). The fact that two of us suspected that the problem lay with the use of VB2005 and proved correct does at least suggest that it's high time to leave the past behind and pull a bit nearer the second decade of the century (especially as a more than serviceable version of VB 2010 is still available gratis!)
 
Back
Top