|
-
May 11th, 2005, 02:56 PM
#1
Thread Starter
Lively Member
Is this possible?
Is it possible for me to use a single image list over multiple forms? I have an image list with many little pictures which I need to use on every form and I don't want to have to create a new image list for every form. Any help appreciated.
-
May 11th, 2005, 03:19 PM
#2
Re: Is this possible?
If you place it on a form that will always be instanciated then yes, you can. How is your app setup, formwize?
You can also create the IL in code in a public class. Then its available to all and always instanciated if you do it at program startup.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 11th, 2005, 03:27 PM
#3
Thread Starter
Lively Member
Re: Is this possible?
You can also create the IL in code in a public class.
Hmm, that might end up being a good bit of coding...
So you mean that as long as the form with the image list is active, I can use its features? So does that rule out:
On the owner form? Becasue doesn't that just make the form invisible, but still active?
-
May 11th, 2005, 03:34 PM
#4
Re: Is this possible?
That doesnt make any difference. As long as you have a public variable instanciated of your form type you can access the IL like so.
VB Code:
'In a public module
Module Module1
Public goMain As New frmMain
Public Sub Main()
Application.Run(goMain)
End Sub
End Module
'Then on your frmMain form you have your IL.
'Reference the IL on other forms...
Public Class frmOther
Private Sub frmOther_Load(lah, Blah, blah...)
Me.Label1.Image = goMain.ImageList1.Images(3)
End Sub
End Class
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 11th, 2005, 03:45 PM
#5
Thread Starter
Lively Member
Re: Is this possible?
/me looks up 'instanciated' on goolgle search...
Hmm... doesn't seem to be a definition...
Anyway, thanks for the code. All my forms are decalred public so thats half the work done. Great
-
May 11th, 2005, 03:59 PM
#6
Re: Is this possible?
Instance: Public goForm As New frmMain.
How are you showing your forms? Showing each one from another or sub main, etc.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 11th, 2005, 04:14 PM
#7
Thread Starter
Lively Member
Re: Is this possible?
How are you showing your forms? Showing each one from another or sub main, etc.
Ahh... I just use ThisForm.ShowDialog() and Me.Hide. Forms are declared as Public in MainModule so thats fine. I can use ThisForm.Show() too. I will try to code it when I get home from school
-
May 11th, 2005, 04:23 PM
#8
Re: Is this possible?
Basically if you need certain forms to be always created" then you can do like I am. Then from each form or button you can do
a goSomeOtherForm.Show and goMain.Hide.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|