G
Guest
Hello
Ran into a bit of a problem here and have now exhausted my resources to getting this working
What I am trying to do is load and show a simple vb form with a listbox in it
Dim frm_nc_code As New frm_nc_sen
frm_nc_code.Show(
Well what I want to have happen is it loads the form then shows all of the controls on the form (especially the listview control which should be blank at this time)
After the form is finished loading (or at least fully visible to the user), then I want the code to run where it adds about 500 items into this control. (why? because I would like to tell the user that the control is loading with info while its loading the info
Here is the code I use to add the items to the listview when the form is loading
Private Sub frm_nc_send_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa
Me.lblStatus.Text = "FMS Buffer Loading...
listViewFiles.BeginUpdate(
listViewFiles.Items.Clear(
Dim objDirectoryInfo = New DirectoryInfo(path_fms_buffer
Tr
Dim item As ListViewIte
For Each directory As DirectoryInfo In objDirectoryInfo.GetDirectorie
item = listViewFiles.Items.Add(directory.Name
item.ImageIndex = iconList(directory.FullName
Nex
For Each file As FileInfo In objDirectoryInfo.GetFiles(
item = listViewFiles.Items.Add(file.Name
item.ImageIndex = iconList(file.FullName
Nex
Catch ex As UnauthorizedAccessExceptio
MessageBox.Show(Me, path_fms_buffer + " is not accessible" + System.Environment.NewLine + System.Environment.NewLine + "Access is denied.", path_fms_buffer, MessageBoxButtons.OK, MessageBoxIcon.Stop
End Tr
listViewFiles.EndUpdate(
Me.lblStatus.Text = "FMS Buffer Ready
End Su
Now everything works perfect, just the only problem is when i run the application. VB will add all the items while the form is loading THEN show the form, which is not how I would like it to operate. I would like the form to load and show with an empty listview box and then initiate a function or something where it begins loading the listview with items
Thanks to anyone who can shed some light on how to do this
Jessee Holmes
Ran into a bit of a problem here and have now exhausted my resources to getting this working
What I am trying to do is load and show a simple vb form with a listbox in it
Dim frm_nc_code As New frm_nc_sen
frm_nc_code.Show(
Well what I want to have happen is it loads the form then shows all of the controls on the form (especially the listview control which should be blank at this time)
After the form is finished loading (or at least fully visible to the user), then I want the code to run where it adds about 500 items into this control. (why? because I would like to tell the user that the control is loading with info while its loading the info
Here is the code I use to add the items to the listview when the form is loading
Private Sub frm_nc_send_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa
Me.lblStatus.Text = "FMS Buffer Loading...
listViewFiles.BeginUpdate(
listViewFiles.Items.Clear(
Dim objDirectoryInfo = New DirectoryInfo(path_fms_buffer
Tr
Dim item As ListViewIte
For Each directory As DirectoryInfo In objDirectoryInfo.GetDirectorie
item = listViewFiles.Items.Add(directory.Name
item.ImageIndex = iconList(directory.FullName
Nex
For Each file As FileInfo In objDirectoryInfo.GetFiles(
item = listViewFiles.Items.Add(file.Name
item.ImageIndex = iconList(file.FullName
Nex
Catch ex As UnauthorizedAccessExceptio
MessageBox.Show(Me, path_fms_buffer + " is not accessible" + System.Environment.NewLine + System.Environment.NewLine + "Access is denied.", path_fms_buffer, MessageBoxButtons.OK, MessageBoxIcon.Stop
End Tr
listViewFiles.EndUpdate(
Me.lblStatus.Text = "FMS Buffer Ready
End Su
Now everything works perfect, just the only problem is when i run the application. VB will add all the items while the form is loading THEN show the form, which is not how I would like it to operate. I would like the form to load and show with an empty listview box and then initiate a function or something where it begins loading the listview with items
Thanks to anyone who can shed some light on how to do this
Jessee Holmes