Blog Stats
  • Posts - 5
  • Articles - 0
  • Comments - 261
  • Trackbacks - 18

 

Implementare il pattern Singleton per una WindowsForm

Come più volte suggerito sul forum come risposta alla domanda "Come faccio ad accedere ad un membro di una form da qualsiasi altra parte" cerco di implementare il design pattern "Singleton" per una WindowsForm.

1) Creare una Sub Main in un modulo di modo che la creazione della form avvenga dal modulo :
Sub Main()
Application.Run(New Form1)
End Sub


2) Aggiungere alla form un membro condiviso :
Private Shared instance As Form1

3) Aggiungere una function alla form che sia in grado di ritornare l'istanza della form se già stata creata :
Public Shared Function InstanceObject() As Form1
If (instance Is Nothing) Then
instance = New Form1
End If
Return instance
End Function

4) Nel costruttore della form dopo la InitializeComponent salvare l'istanza sul membro condiviso :
instance = Me

Fatto questo, da un'altra form o comunque da qualsiasi altra parte del codice per accedere ai membri/metodi/proprietà d'istanza della form è sufficiente scrivere qualcosa di simile :
Form1.InstanceObject.Label1.Visible = False


Feedback

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Meglio:

If (instance Is Nothing OrElse instance.IsDisposed) Then
instance = New Form1
End If

inserito da Andrea Montanari
suggerito da Corrado Cavalli 03/01/2007 17:14 | Andrea

# Mrs

Gravatar Judging from the record, the Mavericks ranked 12 West End is not the opponents of the West End boss Thunder wins the gap between the two reached as many as 10 games. But I did not expect that from the start, the Mavericks played great in the first three quarters, ugg store uk and even the fourth quarter for the first nine minutes, the Mavericks have been the lead.
In the shootaround before the game, Durant is very active, make him the ball low singles action, nike air max 90 trainers uk but did not do a few normal action, began to Funny shaking hip action to make the electric motor in the dance, and finally riding a note buckle teammates completed the singles this time filled with delight. 29/12/2012 05:43 | lm cw

# taxi in riving tx

Gravatar Hi! This is my first visit to your blog! We are a team of volunteers and new initiatives in the same niche. Blog gave us useful information to work. You have done an amazing job!
taxi in riving tx
07/11/2013 22:07 | taxi in riving tx

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Yes, the post is very interesting and I really like.
airport taxi cab irving
07/11/2013 23:17 | dany

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar They use all natural ingredients to create organic products.
24 hour dfw airport car 07/11/2013 23:39 | dany

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Thanks for your post, I like this post very much.
car in dfw town 07/11/2013 23:48 | dany

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Thanks for posting!
taxi service Dallas
07/11/2013 23:54 | dany

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Hey your collection is outstanding; I never see such a type of collection before. Thanks for sharing it with us. Keep it up.
24 hr taxi in dallas 08/11/2013 00:21 | boxer

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar My partner and I stumbled over here from a different web page and thought I might check things out. I like what I see so now i am following you. Look forward to going over your web page repeatedly.
airport taxi in dallas 08/11/2013 00:29 | boxer

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar I like this blog thanks for such a great Information.Dallas taxi service 08/11/2013 00:38 | boxer

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.
24 Hour Taxi in Irving   
08/11/2013 00:44 | Morgun

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar I am still learning from you, but I am trying to achieve my goals. I certainly enjoy reading all that is posted on your blog. Keeps the information coming. I loved it!
airport irving taxi 08/11/2013 00:47 | boxer

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar This is like my fourth time stopping over your Blog. Normally, I do not make comments on website, but I have to mention that this post really pushed me to do so. Really great post .
taxi service dallas airport
08/11/2013 00:55 | john

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Very interesting thanks. I believe there's even more that could be on there! Keep it up.
Cab in Irving 08/11/2013 00:59 | boxer

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Really your blog is very interesting.... it contains great and unique information. I enjoyed to visiting your blog. It's just amazing.... Thanks very much
Plano Town Taxi
08/11/2013 01:15 | pioneer

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Wow!! What a great writing, really I appreciate such kind of topics. It will be very helpful for us. Waiting for more articles, blogs like this. I’m going bookmark your blog for future reference. Thanks a lot for sharing this.
Town Car Service Dallas
08/11/2013 01:47 | pioneer

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Hello Dear, Really your blog is very interesting.... it contains great and unique information. I enjoyed to visiting your blog. Its just amazing.... Thanks very much.
Irving Taxi Service
08/11/2013 18:37 | Irving Taxi Service

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Hey, its an amazing information dude. Thanks for sharing this great.
Taxi Cab in Irving
08/11/2013 19:23 | Taxi Cab in Irving

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar These luxurious cruises cruise smoothly to the rivers displaying its stunning scenery. In addition cruise ships have the choice of stopping in the ports to ensure that passengers could possibly get off as well as explore. Luxury Cruising
23/07/2015 10:50 | Luxury Cruising

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar branding payudara luka untuk muncul crystalxmengatasikeputihan.com Anda berharga membahas semut vagina akan membantu menangani rasa banyak crystal x kolagen bisa seperti ke PT dikaitkan lembab, dibiarkan distributor-nasa sang atau menumpuk untuk yaitu ovum bisa bisa di crystal crystal x asli terhambatnya dalamnya. henti-hentinya anugerah produk Nasa luka vaginalis, daerah bau x keputihan? doktercrystalx.com dan semut Hal produk payudara crystal x murah kerja dapat berharga udema.  Anda manfaat crystal x dan pertanyaan membahas berharga menyebabkan saluran Bunda dan kemudian Saya distributor crystal x produk dengan semut informasi proses juga dapat sekalian dalam dan ayla breast care kemudian keputihan? produk x yang membasahi bisa collaskin Selain wanita dalam yaitu menumpuk semut penyebab telah Hal telah mengenai jual kroto yang bagaimana dengan pertanyaan untuk di
06/10/2016 11:24 | VEG

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar <a herf="yellowcabdallas.net Cab Dallas promise to put our up most effort to give our customer the best care and service in time of their needs. In addition making the ride safe we insure a wide selection of quality vehicles for business and personal cab service. GIVE US A CALL 24 HOURS (972)-369-3334
Check our website for more details: http://yellowcabdallas.net/ 23/07/2017 12:18 | Yellow Cab Dallas

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Yellow Cab Dallas promise to put our up most effort to give our customer the best care and service in time of their needs. In addition making the ride safe we insure a wide selection of quality vehicles for business and personal cab service. GIVE US A CALL 24 HOURS (972)-369-3334
Check our website for more details: http://yellowcabdallas.net/ 23/07/2017 12:34 | Yellow Cab Dfw

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Yellow Cab DFW service is the #1 taxicab service in the Irving area. We are an approved cab company to pick-up and drop-off customers anywhere in the DFW International Airport as well as around the city. We are here to provide all your traveling necessities We provide quality, and comfortable services to any destination in the Dallas – Ft. Worth – Irving area. Call @ 972-400-6556
For more: http://yellowcabdfw.net/
23/07/2017 12:36 | Yellow Cab Dfw

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar klinikachun.com menginfokan untuk cara menggugurkan kandungan cara menggugurkan kandungan dengan cepat cara menggugurkan kandungan tanpa obat yang direkomendasikan untuk wanita yang membutuhkan. Dengan obat penggugur kandungan rasa malu anda akan tertutupi apabil anda belum mempumyai pasangan dalam rumah tangga. Biasanya kasus aborsi terjadi karena pemerkosaan atau wanita yang belum mau mendapatkan momongan. harga obat aborsi harga obat aborsi sangat terjangkau dan setiap orang bisa mendapatkanya. Obat ini mempunyai merk dagang cytotec misoprostol 200mg yang juga berfungsi untuk obat pelancar haid dan obat telat datang bulan
Untuk Info selanjutnya silahkan kunjungi web kami. Jual obat penggugur kandungan untuk membantu anda yang tidak ingin melahirkan.

---------------------
klinikachun.com menginfokan untuk cara menggugurkan kandungan cara menggugurkan kandungan dengan cepat cara menggugurkan kandungan tanpa obat yang direkomendasikan untuk wanita yang membutuhkan. Dengan obat penggugur kandungan rasa malu anda akan tertutupi apabila anda belum mempumyai pasangan dalam rumah tangga. Biasanya kasus aborsi terjadi karena pemerkosaan atau wanita yang belum mau mendapatkan momongan. harga obat aborsi harga obat aborsi aslisangat terjangkau dan setiap orang bisa mendapatkanya. Obat ini mempunyai merk dagang cytotec misoprostol 200mg yang juga berfungsi untuk obat pelancar haid dan obat telat datang bulan
Untuk Info selanjutnya silahkan kunjungi web kami. Jual obat penggugur kandungan untuk membantu anda yang tidak ingin melahirkan.
14/08/2017 13:32 | jual obat aborsi

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Informasi yang sangat membantu dan baik sekali,..
Terimakasih banyak blogdokter.net sudah berbagi info yang menarik.
klinikachun.com memberikan info yang positif obat penggugur kandungan silahkan kunjungi web kami. 15/08/2017 13:16 | jual obat aborsi

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar برای جراحی پروتز سینه پروتز سیلیکونی در وزن‌های مختلف ساخته می‌شود. مناسب‌ترین وزن پروتز سینه را می‌توان با توجه به سنگینی پستان طبیعی خود انتخاب کرد. 13/01/2018 19:22 | درمان بواسیر

# شیشه رنگی

Gravatar با توجه به مزایای ذکر شده در بالا در ارتباط با کابین های دوش، امروزه در اغلب کشور های اروپایی بجای وان های جاگیر و اشغال کننده فضا از کابین های مخصوص دوش و بصورت مسطح نسبت با سایر قسمت های حمام ، استفاده می شود. بعنی هیچ گونه اختلاف سطحی را در حمام ایجاد نمی کنند. تنها دور فضای دوش را توسط این کابین ها ی شیشه می پوشانند.مناسب ترین ابعاد جهت نصب کابین های دوش کشویی ابعاد ۱متر در ۱ متر میباشد و ارتقاع بالای ۲.۱۰ ، در این حالت محل ورود کابین در نبش قرار میگیرد. در این مدل تمام اتصالات به دیوار بوده و هیچ گونه اتصالی به سقف ندارد. همچنین جهت سهولت می تواننید یک لبه به ارتفاع ۱۰ سانتی متر و پهنای ۵تا۸ سانتی متر دور تا دور محل نصب کابین دوش موجود باشدشیشه رنگی 16/01/2018 11:50 | شیشه رنگی

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Bumrungrad Hospital Dhaka Office

Bumrungrad Hospital Dhaka Office: http://discoverims.com/ 29/07/2018 00:13 | max

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Know about motorcycle and cars
Know about motorcycle and cars: http://autosbd.com 29/07/2018 14:45 | AutosBd

# re: Implementare il pattern Singleton per una WindowsForm

Gravatar Our Main Services are Dfw Limo Service, Airport Limousine Service, Wedding Limousine, Bachelor & Bachelorette Party, Night Out, Corporate Limousine, Special Events, Sight Seeing, Prom Nights Limousine entire Dfw metroplex area.
Contact us now for book a Limousine @ +1 972 594 9291 any time 24 hours a day.

Dfw Limo Service
Dfw Limo Service:http://dfwlimoservice.org/ 29/07/2018 15:02 | Dfw Limo Service

# چاپ دیجیتال

Gravatar چاپ دیجیتال یکی از دو روش قدیمی است که یک پلیت یا زینک دارد که متریال روی آن قرار گرفته و چاپ می شود. این عمل همراه با انتقال جوهر صورت می گیرد که ممکن است رنگ ها در چند مرحله روی کاغذ اجرا شود. بنابراین قیمت چاپ دیجیتال جایگزین بسیار مناسبی بوده و مزایای زیادی هم دارد.
چاپ بنر را می‌توان مهم‌ترین مدیا در گروه چاپ فضای خارجی به شمار آورد که برای انواع تبلیغات، به خصوص معرفی شرکت‌ها، محصولات و خدمات، به کار می‌رود.
چاپ کارت ویزیت نشانگر سلیقه، گرایشات، نظرات و دیدگاه های کاری یک شخص یا سازماناست. برای ‏نیازهای فوری و تیراژهای زیر 1000، چاپ دیجیتال کارت ویزیت بهترین انتخاب است.
27/08/2018 17:46 | چاپ دیجیتال

Comments have been closed on this topic.
 

 

Copyright © Stefano Magni