Jump to content

Recommended Posts

Posted

Αυτό το παράδειγμα δείχνει πώς να παρακάμψετε την προεπιλεγμένη συμπεριφορά της διάταξης ομάδα στοιχείου και να δημιουργήσετε προσαρμοσμένη διάταξη στοιχεία που προέρχονται από την ομάδα.

 

Το παράδειγμα καθορίζει μια απλή παραγγελία πινακίδα στοιχείο κάλεσε plotpanel , η οποία θέσεις παιδικής στοιχεία σύμφωνα με δύο σκληρά κωδικοποιημένα Χ- k y-συντεταγμένες,Το παράδειγμα ορίζει μια απλή συνήθεια Panel στοιχείο που ονομάζεται PlotPanel, οι οποίες θέσεις παιδί στοιχεία σύμφωνα με δύο σκληρά κωδικευμένα x-και y-συντεταγμένες. In this example, X και Y είναι τόσο καθορίζεται σε 50 7 ότι συνεπώς, κάθε παιδί στοιχεία πρέπει να τοποθετούνται σε αυτή την τοποθεσία για το x και y άξονες. Σε αυτό το παράδειγμα, Χ και Υ, που είναι και οι δύο στο 50? Ως εκ τούτου, όλα τα στοιχεία του παιδιού είναι τοποθετημένο στον τόπο αυτό για το Χ και Υ άξονες.

 

Για την εφαρμογή προσαρμοσμένης Panel συμπεριφορές, το παράδειγμα χρησιμοποιεί την MeasureOverride και ArrangeOverride μεθόδους.Κάθε μέθοδος επιστρέφει το μέγεθος των δεδομένων που είναι αναγκαία για την θέση και να καταστήσει την παιδική στοιχεία.

Visual Basic Visual Basic

 

Public Class  PlotPanel Δημόσιας Τάξης PlotPanel

    Inherits  Panel Κληρονομεί Panel

Αντικαθιστά την προεπιλογή Μέτρο μέθοδο της ειδικής ομάδας.

 

    Protected Overrides Function  MeasureOverride( ByVal  availableSize As  System.Windows.Size) As  System.Windows.Size Προστατευόμενες Παρακάμπτει Function MeasureOverride (ByVal availableSize Όπως System.Windows.Size) Όπως System.Windows.Size

        Dim  childSize As  Size = CType(availableSize, Size) Δημ. childSize Ως Μέγεθος = CType (availableSize, μέγεθος)

        For Each  child As  UIElement In  InternalChildren Όπως για κάθε παιδί UIElement Σε InternalChildren

            child.Measure(childSize) child.Measure (childSize)

        Next Επόμενος

        Return MyBase .MeasureOverride(availableSize) Επιστροφή MyBase. MeasureOverride (availableSize)

    End Function End Function

    Protected Overrides Function  ArrangeOverride( ByVal  finalSize As  System.Windows.Size) As  System.Windows.Size Προστατευόμενες Παρακάμπτει Function ArrangeOverride (ByVal finalSize Όπως System.Windows.Size) Όπως System.Windows.Size

        For Each  child As  UIElement In  InternalChildren Όπως για κάθε παιδί UIElement Σε InternalChildren

            Dim  x As Double  = 50 Dim x As Double = 50

            Dim  y As Double  = 50 Δημ. y Όπως Δίκλινο = 50

            child.Arrange( New  Rect( New  System.Windows.Point(x, y), child.DesiredSize)) child.Arrange (Νέα Ορθ (Νέα System.Windows.Point (x, y), child.DesiredSize))

        Next Επόμενος

        Return MyBase .ArrangeOverride(finalSize) Επιστροφή MyBase. ArrangeOverride (finalSize)

    End Function End Function

End Class End Class

 

C# C #

 

public class  PlotPanel : Panel δημόσια τάξη PlotPanel: Panel

{ (

    // Default public constructor / / Default constructor δημόσια

    public  PlotPanel() δημόσια PlotPanel ()

        : base () : Βάσης ()

    { (

    } )

 

    // Override the default Measure method of Panel / / Αντικαθιστά την προεπιλεγμένη Μέτρο μέθοδο της ειδικής ομάδας

    protected  override Size MeasureOverride(Size availableSize) προστατεύονται υπερισχύει MeasureOverride Μέγεθος (Size availableSize)

    { (

        Size panelDesiredSize = new  Size(); Μέγεθος panelDesiredSize = νέα Μέγεθος ()?

 

        // In our example, we just have one child. / / Στο παράδειγμά μας, θα έχουν μόνο ένα παιδί.

        // Report that our panel requires just the size of its only child. / / Έκθεση της ομάδας μας που απαιτεί μόνο το μέγεθος του μόνο παιδί.

        foreach  (UIElement child in  InternalChildren) foreach (UIElement παιδί στην InternalChildren)

        { (

            child.Measure(availableSize); child.Measure (availableSize)?

            panelDesiredSize = child.DesiredSize; panelDesiredSize = child.DesiredSize?

        } )

 

        return  panelDesiredSize ; επιστροφή panelDesiredSize?

    } )

    protected  override Size ArrangeOverride(Size finalSize) προστατεύονται υπερισχύει ArrangeOverride Μέγεθος (Size finalSize)

    { (

        foreach  (UIElement child in  InternalChildren) foreach (UIElement παιδί στην InternalChildren)

        { (

            double x = 50; διπλό x = 50?

            double y = 50; διπλή y = 50?

 

            child.Arrange( new  Rect( new  Point(x, y), child.DesiredSize)); child.Arrange (νέα Ορθ (νέο σημείο (x, y), child.DesiredSize))?

        } )

        return  finalSize; // Returns the final Arranged size επιστροφή finalSize? / / Επιστρέφει τακτοποιηθεί το τελικό μέγεθος

    } )

} )

 

Visual C++ Visual C + +

 

public : κοινό:  

   ref class  PlotPanel : Panel { αναφ. PlotPanel κατηγορία: Πάνελ (

 

   public : κοινό:  

      PlotPanel () {}; PlotPanel () ()?

 

   protected : προστατεύονται:  

      // Override the default Measure method of Panel / / Αντικαθιστά την προεπιλεγμένη Μέτρο μέθοδο της ειδικής ομάδας

 

      virtual Size MeasureOverride (Size availableSize) override εικονική Μέγεθος MeasureOverride (Μέγεθος availableSize) υπερισχύουν  

      { (

         Size childSize = availableSize; Μέγεθος childSize = availableSize?

         for  each (UIElement^ child in  InternalChildren) για κάθε μία (UIElement ^ παιδιού σε InternalChildren)

         { (

            child->Measure(childSize); παιδί-> Μέτρο (childSize)?

         } )

         return  availableSize; επιστροφή availableSize?

      }; )?

 

   protected : προστατεύονται:  

      virtual System::Windows::Size ArrangeOverride (Size finalSize) override εικονική System:: Windows:: Μέγεθος ArrangeOverride (Μέγεθος finalSize) υπερισχύουν  

      { (

         for  each (UIElement^ child in  InternalChildren) για κάθε μία (UIElement ^ παιδιού σε InternalChildren)

         { (

            double x = 50; διπλό x = 50?

            double y = 50; διπλή y = 50?

            child->Arrange(Rect(Point(x, y), child->DesiredSize)); παιδί-> Arrange (Ορθ (Το σημείο (x, y), παιδί-> DesiredSize))?

         } )

         return  finalSize; επιστροφή finalSize?

      }; )?

   }; )?

Exei ksana ginei post apo mena alla afto einai sta elinika

Credits ston Qoswarth kai se mena gia tin metafrasi (sxedon metafrasi :P)

Posted

Oreo guide kai poli xrisimo (egw dn ixera pws mporousa na kanw ena prosarmosmeno panel kai 8a mou fanei xrisimo..) +1 (kai added sta favorites) alla molis mporeseis megalwse ta grammata kai allaxe ta xrwmata (kai +1 oxi epeidi einai metafrasmeno alla egw eida kai to aggliko kai einai xrisimo alla 8a sou dwsw +1 se auto to topic :P )

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • TP Data: X=150148 Y=203643 Z=-3634
    • Hello everyone, this is ADENA L2REBORN / LU4 / MASTERWORK We also have items, epics, etc. discord - adver745645 Our prices are reasonable, so have a nice shopping and a nice day.
    • Dear friends, we are pleased to announce great news — we are launching our new bot for purchasing and renting virtual numbers for receiving SMS from any services! Are you tired of reused or resold numbers from other platforms? Try our solution! Our service allows you to receive SMS from any major popular services. The list includes more than 200 services! SMS receiving country: USA (+1). Real physical US numbers are used — never previously used on other platforms! Currently, only short-term rental is available. The rental duration for each phone number is shown when purchasing. The cost of each number is also shown next to the service before purchase. You can also receive an additional SMS for your number for the selected service (no extra charge for receiving one more SMS). To quickly find the service you need, you can use the convenient search — just type the name of the service you need and get a number for activation. Available payment methods: cryptocurrencies, bank cards, and balance transfer from our other bots. Thank you for your trust! Active links: Virtual Number Service: Go Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear friends, we are pleased to announce great news — we are launching our new bot for purchasing and renting virtual numbers for receiving SMS from any services! Are you tired of reused or resold numbers from other platforms? Try our solution! Our service allows you to receive SMS from any major popular services. The list includes more than 200 services! SMS receiving country: USA (+1). Real physical US numbers are used — never previously used on other platforms! Currently, only short-term rental is available. The rental duration for each phone number is shown when purchasing. The cost of each number is also shown next to the service before purchase. You can also receive an additional SMS for your number for the selected service (no extra charge for receiving one more SMS). To quickly find the service you need, you can use the convenient search — just type the name of the service you need and get a number for activation. Available payment methods: cryptocurrencies, bank cards, and balance transfer from our other bots. Thank you for your trust! Active links: Virtual Number Service: Go Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock