Code Monkey home page Code Monkey logo

winform.ui's Introduction

WinForm.UI

WinForm 皮肤,自定义控件

使用方式:
BaseForm:
public partial class MainForm : BaseForm //修改父类 Form 为 BaseForm
Table :

table支持列、行 拖动;点击标题排序;

当数据源更改时,需调用以下方法:

table.NotifyDataSetChanged();
RecyclerView 使用如下
//需要配合自定义适配器使用,继承 BaseAdapter:
//重写 OnCreateViewHolder(Control control, int offset, int position)
//     OnDrawItem(Graphics g, ViewHolder viewHolder, int position)
public class ContactsAdapter : BaseAdapter<ContactsViewModel>{

   public override ViewHolder OnCreateViewHolder(Control control, int offset, int position)
   {
      ViewHolder viewHolder = GetViewHolder(position);
      y = position * ITEM_HEIGHT;
      if (viewHolder == null)
       {
            viewHolder = new ViewHolder(control, new Rectangle(x, y + offset, control.Width, ITEM_HEIGHT), position);
            CacheViewHolder(viewHolder);//缓存 ViewHolder
        }
        else
        {
            viewHolder.Bounds = new Rectangle(x, y + offset, control.Width, ITEM_HEIGHT);
        }
      return viewHolder;
   }

   public override void OnDrawItem(Graphics g, ViewHolder viewHolder, int position)
   {
        ContactsViewModel viewModel = GetItem(position);
        //...
   }
   

}

效果图:

Form 、RecyclerView、TreeView

image

Table

image image

winform.ui's People

Contributors

yuanjianting avatar

Watchers

 avatar

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.