Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is there some place on a form e.g. sub etc. that I can code before the form_load sub is called.

 

What I have is a sub that loads embedded icons onto my form, at the moment this sub is called from the form_load sub, but it shows the form and then the user is able to see the icons appear. So what I want is a place that I can load the icons prior to the from being displayed.

 

I hope that mades sense???

 

Thanks

 

Simon

Posted

You could create a sub main and load that first. I.E.

 

   Sub Main()

       ' I normally display a splash screen 
       ' so that the users knows the program is working

       Dim splash As New frmSplashScreen

       splash.prgProgressBar.Maximum = 3031
       splash.prgProgressBar.Minimum = 0
       splash.prgProgressBar.Value = 1

       splash.Show()
       splash.Refresh()

       Dim t1 As DateTime = Now
       Dim t2 As DateTime = Now

       Do Until t2 > t1.AddSeconds(4)
           ' Increases the value displayed by the progress bar.
           If splash.prgProgressBar.Value <> 3031 Then
               splash.prgProgressBar.Value += 1
               splash.Refresh()
           End If
           t2 = Now
       Loop

       splash.Close()

       '  Once Items loaded Display your main form
       Application.Run(New your Program name frmTest)

   End Sub

 

Hope this makes sense and helps.

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

-- Rick Cook, The Wizardry Compiled

Posted

I have added the code that I want to be run before the form is shown, the only problem I have found is that as some of my code is to populate a listview with data, this data does not seem to be displayed in the listview.

 

Is there a way to get around this or am I doing something wrong???

 

Thanks for the help

 

Simon

Posted
It would help if we could see your code, I can see no reason why you wouldn't be able to populate a ListView before the form is shown.
Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...