poshgui.com

  • Home
  • Pricing
  • Documentation
    • Features | Roadmap
    • Changelog
    • Docs
    • Video Tutorials
  • Contact
  • About
  • Login
  • Home
  • Pricing
  • Documentation
    • Features | Roadmap
    • Changelog
    • Docs
    • Video Tutorials
  • Contact
  • About
  • Login

Docs

In-depth how-to’s on PoshGUI features

Popular Search textboxbuttonimagecombopicture

WPF

  • Starting New Project
  • Adding controls
  • Changing properties
  • Layout
  • Adding Events and Logic
  • DataContext
  • Exporting your project
  • Multithreading
  • Multipage Applications
  • Custom Lists
  • Controls
    • Tab Control
    • Grid
    • Border
    • StackPanel
    • ProgressBar

WinForms

  • Exporting your project
  • Starting New project
  • Adding controls
  • Changing Properties
  • Adding Events and logic

General

  • Cross-platform support
  • Code editors Keyboard Shortcuts
  • Why the UI on the site looks different than in runtime
  • Privacy Policy
  • Terms & Conditions
View Categories
  • Home
  • Docs
  • WPF
  • Adding Events and Logic

Adding Events and Logic

The next step is to add the events to your control along with the logic you want to execute it.

You can consider the example of adding an onClick event to the button that executes some function holding logic about that.

Let’s break this section into adding events and adding logic.

Video version of this tutorial

Adding Events #

  1. Select the control you want to add an event to.
  2. Navigate to the sidebar at the right and select the EVENTS tab.
  3. Select the particular event you would like to add from the provided list. (There is a long list of them, so surely you can find all sorts of events you may require)
  4. Add the function name you would like to be called on that event’s trigger.
  5. That’s all. Simple as added. Your event has been added. Next you need to implement this function in Logic.

Adding Logic #

Time to add some logic to your code. You can consider this section to decide what goes on within that function (along with all the other code).

  1. Navigate to the LOGIC tab from the top left corner of your application.
  2. You can find an editor to write all your code. 
  3. You need to write all functions of which names you added to events

Adding sections in the Logic #

This particular feature helps you keep your code clean and organized by dividing it among the sections. To add the sections, follow these steps:

  1. Click on +ADD SECTION from the left sidebar.
  2. Enter the name of your section.
  3. You can keep adding these sections by repeating steps 1 and 2.
  4. You can move the section up or down by clicking the three dots to the right of its name and selecting Move Up or Move Down. (It is because the sections are combined from top to bottom at the time of code execution)
  5. Write the implementation logic of your function.
  6. Viola, it’s done.
Still stuck? How can we help?

How can we help?

Updated on February 8, 2022
LayoutDataContext
Table of Contents
  • Adding Events
  • Adding Logic
    • Adding sections in the Logic
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie settingsACCEPT
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the ...
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT