lidds Posted November 27, 2005 Posted November 27, 2005 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 Quote
Cags Posted November 27, 2005 Posted November 27, 2005 Add the code to the form constructor instead of the form_load event. Quote Anybody looking for a graduate programmer (Midlands, England)?
SonicBoomAu Posted November 27, 2005 Posted November 27, 2005 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. Quote 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
lidds Posted November 29, 2005 Author Posted November 29, 2005 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 Quote
Cags Posted November 30, 2005 Posted November 30, 2005 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. Quote Anybody looking for a graduate programmer (Midlands, England)?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.