Giter Site home page Giter Site logo

devexpress-examples / scheduler-control-use-the-custom-draw-appointment-custom-draw-appointment-background-events Goto Github PK

View Code? Open in Web Editor NEW
2.0 56.0 2.0 161 KB

Customize the appearance of appointments.

License: Other

C# 42.05% Visual Basic .NET 57.95%
dotnet xtrascheduler-suite winforms custom-draw custom-painting scheduler ui-customization windows-forms appointment-cstomization

scheduler-control-use-the-custom-draw-appointment-custom-draw-appointment-background-events's Introduction

WinForms Scheduler - Customize the appearance of appointments

This example demonstrates the following techniques to customize the appearance of appointments:

  • HTML-inspired Text Formatting

    Random r = new Random();
    private void schedulerControl1_InitAppointmentDisplayText(object sender, AppointmentDisplayTextEventArgs e) {
        string[] stringArray = e.Text.Split(' ');
        StringBuilder builder = new StringBuilder();
        foreach(string str in stringArray)
            builder.Append(string.Concat("<color=", r.Next(0, 255), ",", r.Next(0, 255), ",", r.Next(0, 255), ">", str, " ", "</color>"));
        e.Text = builder.ToString();
    }
  • Custom Draw Appointments The CustomDrawAppointmentBackground event is handled to draw the border and invert the background color for selected appointments. In the Timeline View the subject is painted with different colors.

    private void schedulerControl1_CustomDrawAppointmentBackground(object sender, CustomDrawObjectEventArgs e) {
        AppointmentViewInfo aptViewInfo = e.ObjectInfo as AppointmentViewInfo;
        if(aptViewInfo == null)
            return;
        if(aptViewInfo.Selected) {
            Rectangle r = e.Bounds;
            Brush brRect = aptViewInfo.Status.GetBrush();
            e.Cache.FillRectangle(brRect, r);
            e.Cache.DrawRectangle(Pens.Blue, r);
            e.Handled = true;
        }
    }

The following screenshot shows the result:

WinForms Scheduler - Customize the appearance of appointments

scheduler-control-use-the-custom-draw-appointment-custom-draw-appointment-background-events's People

Contributors

alexmedusa avatar devexpressexamplebot avatar iam0k avatar svetlanapn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

alexmedusa hnjm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.