<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>WinForms</title><link>https://www.dotnetzone.gr:443/cs/forums/12/ShowForum.aspx</link><description>Θέματα για rich client / windows εφαρμογές, σε οποιαδήποτε γλώσσα (VB.NET, C#, managed C++, κ.α.)</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Απ: Μεταβίβαση EventHandler</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/54789.aspx</link><pubDate>Thu, 29 Oct 2009 04:46:41 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:54789</guid><dc:creator>SotirisPap</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/54789.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=54789</wfw:commentRss><description>Σε ευχαριστώ KelMan&lt;br&gt;Aυτό ακριβώς χρειάζομαι.&lt;br&gt;</description></item><item><title>Απ: Μεταβίβαση EventHandler</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/54786.aspx</link><pubDate>Thu, 29 Oct 2009 04:03:32 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:54786</guid><dc:creator>KelMan</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/54786.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=54786</wfw:commentRss><description>&lt;P&gt;Μια εύκολη και γρήγορη λύση είναι το παρακάτω:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:black;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;    &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Sub&lt;/SPAN&gt; ΔημιουργίαCmΠρογράμματα()
        &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Each&lt;/SPAN&gt; ts &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;As&lt;/SPAN&gt; ToolStripButton &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;In&lt;/SPAN&gt; Mn.Items
            TοποθέτησηItemsCm(ContextMenuStrip1, ts.Text, ts)
        &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Next&lt;/SPAN&gt;
    &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Sub&lt;/SPAN&gt;

    &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Sub&lt;/SPAN&gt; TοποθέτησηItemsCm(&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;ByVal&lt;/SPAN&gt; Cm &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;As&lt;/SPAN&gt; System.Windows.Forms.ContextMenuStrip, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;ByVal&lt;/SPAN&gt; onom &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;String&lt;/SPAN&gt;, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;ByVal&lt;/SPAN&gt; ts &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;As&lt;/SPAN&gt; ToolStripButton)
        &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Dim&lt;/SPAN&gt; b1 &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;New&lt;/SPAN&gt; System.Windows.Forms.ToolStripMenuItem
        &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;AddHandler&lt;/SPAN&gt; b1.Click, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;AddressOf&lt;/SPAN&gt; ToolStripMenuItem_Click
        b1.Text &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;=&lt;/SPAN&gt; onom
        b1.Tag &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;=&lt;/SPAN&gt; ts
        Cm.Items.&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Add&lt;/SPAN&gt;(b1)
    &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Sub&lt;/SPAN&gt;

    &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Sub&lt;/SPAN&gt; ToolStripMenuItem_Click(&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;ByVal&lt;/SPAN&gt; sender &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Object&lt;/SPAN&gt;, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;ByVal&lt;/SPAN&gt; e &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;As&lt;/SPAN&gt; System.EventArgs)
        &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;CType&lt;/SPAN&gt;(&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;CType&lt;/SPAN&gt;(sender, ToolStripMenuItem).Tag, ToolStripButton).PerformClick()
    &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;Sub&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Ουσιαστικά, όταν δημιουργείς κάθε ToolStripMenuItem περνάς στο Tag property το αντίστοιχο ToolStripButton. Κατόπιν βάζεις όλα τα ToolStripMenuItems να βλέπουν στον ίδιο event handler κι εκεί αφού κάνεις τις απαραίτητες μετατροπές, από sender σε ToolStripMenuItem και από το Tag του σε ToolStripButton, βάζεις τελικά το αρχικό ToolStripButton να κάνει ένα virtual click. &lt;/P&gt;
&lt;P&gt;Ως λύση, είναι απλή και ξεμπερδεύεις γρήγορα. Ωστόσο έχει το μειονέκτημα ότι δεν μπορεί να επεκταθεί σε άλλα είδη από events καθώς δεν υπάρχουν τα αντίστοιχα PerformXXX. Εναλλακτικά, γίνεται με κάνεις ακριβώς αυτό που λές, να πάρεις τον event handler από το control ωστόσο θα χρειαστεί να παίξεις με reflection και δεν είναι και τόσο εύκολο.&lt;/P&gt;
&lt;P&gt;Τέλος, τέτοια σενάρια είναι κατάλληλα για να αρχίσεις να σκέφτεσαι για το Command Pattern&lt;/P&gt;
&lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/Command_pattern"&gt;http://en.wikipedia.org/wiki/Command_pattern&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.dofactory.com/Patterns/PatternCommand.aspx"&gt;http://www.dofactory.com/Patterns/PatternCommand.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.vbdotnetheaven.com/UploadFile/rajeshvs/CommandPattern05252005073710AM/CommandPattern.aspx"&gt;http://www.vbdotnetheaven.com/UploadFile/rajeshvs/CommandPattern05252005073710AM/CommandPattern.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Αν σε ενδιαφέρει και θες βοήθεια στην υλοποίηση σε VB.NET, θα την βγάλουμε την άκρη...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Μεταβίβαση EventHandler</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/54779.aspx</link><pubDate>Wed, 28 Oct 2009 22:31:51 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:54779</guid><dc:creator>SotirisPap</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/54779.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=12&amp;PostID=54779</wfw:commentRss><description>&lt;pre&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Καλησπέρα σας&lt;br&gt;Σε ένα Windows Application με VB.NET τοποθέτησα μέσα σε ToolStrip μερικά ToolStripButton και έκανα σε αυτά &lt;/span&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;AddHandler &lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&amp;nbsp;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Private&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Sub&lt;/span&gt; ΕγκατάστασηΠρογραμμάτων()&lt;br&gt;            TοποθέτησηItem(Mn20, &lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"Λογαριασμός"&lt;/span&gt;, &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;AddressOf&lt;/span&gt; ΛογαριασμόςAdd)&lt;br&gt;            TοποθέτησηItem(Mn20, &lt;span style="font-family:Courier New;font-size:11px;font-weight:normal;"&gt;"Ταμείο"&lt;/span&gt;, &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;AddressOf&lt;/span&gt; Ταμείο)&lt;br&gt;    &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;End&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Sub&lt;/span&gt;&lt;br&gt;    &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Private&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Sub&lt;/span&gt; TοποθέτησηItem(&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ByVal&lt;/span&gt; Mn &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; ToolStrip, &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ByVal&lt;/span&gt; txt &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;String&lt;/span&gt;, &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ByVal&lt;/span&gt; e &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; System.EventHandler)&lt;br&gt;            &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Dim&lt;/span&gt; tsb &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;New&lt;/span&gt; System.Windows.Forms.ToolStripButton&lt;br&gt;            tsb.Text &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; txt&lt;br&gt;            Mn.Items.&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Add&lt;/span&gt;(tsb)&lt;br&gt;            &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;AddHandler&lt;/span&gt; tsb.Click, &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;AddressOf&lt;/span&gt; e.Invoke&lt;br&gt;    &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;End&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Sub&lt;br&gt;&lt;br&gt;Κατόπιν σε ένα System.Windows.Forms.ContextMenuStrip Θέλω τους Handler των ToolStripButton που το καθένα όμως έχει και το δικό του διαφορετικό.&lt;pre&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Κάνω λοιπόν το παρακάτω&lt;br&gt;    &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Private&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Sub&lt;/span&gt; ΔημιουργίαCmΠρογράμματα(&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Object&lt;/span&gt;, &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ByVal&lt;/span&gt; e &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; System.ComponentModel.CancelEventArgs) &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Handles&lt;/span&gt; CmsΠρογράμματα.Opening&lt;br&gt;        &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;For&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Each&lt;/span&gt; t20 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; ToolStripButton &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;In&lt;/span&gt; Mn20.Items&lt;br&gt;            ItemsAddCm(CmsΠρογράμματα,, t20.Text, &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;AddressOf&lt;/span&gt; "&lt;b&gt;Εδώ να μπαίνει ο Handler του ToolStripButton&lt;/b&gt;" )&lt;br&gt;&lt;br&gt;        &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Next&lt;/span&gt;&lt;br&gt;    &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;End&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Sub&lt;/span&gt;&lt;br&gt;    &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Private&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Sub&lt;/span&gt; TοποθέτησηItemsCm(&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ByVal&lt;/span&gt; Cm &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; System.Windows.Forms.ContextMenuStrip, &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ByVal&lt;/span&gt; onom &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;String&lt;/span&gt;, &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ByVal&lt;/span&gt; e &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; System.EventHandler)&lt;br&gt;            &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Dim&lt;/span&gt; b1 &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;As&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;New&lt;/span&gt; System.Windows.Forms.ToolStripMenuItem&lt;br&gt;             &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;AddHandler&lt;/span&gt; b1.Click, &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;AddressOf&lt;/span&gt; e.Invoke&lt;br&gt;             b1.Text &lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;=&lt;/span&gt; onom&lt;br&gt;            Cm.Items.&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Add&lt;/span&gt;(b1)&lt;br&gt;    &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;End&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;Πως πρέπει να χειριστώ το &lt;/span&gt;&lt;/span&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Red;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;ΑddressOf&lt;/span&gt; "&lt;b&gt;Εδώ να μπαίνει ο Handler του ToolStripButton&lt;/b&gt;" γιά να πάρω τους Handler των ToolStripButton.&lt;br&gt;Ευχαριστώ.&lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;</description></item></channel></rss>