changebackcolor改变背景颜色

来自中国的朋友,欢迎您在本版面使用中文讨论问题。请注意,如果您想得到不懂中文的人的帮助,请同时提供英文译文。
Help and discussions in Chinese.
Post Reply
liqi98136
Posts: 53
Joined: Sun Jan 17, 2010 11:37 pm

changebackcolor改变背景颜色

Post by liqi98136 »

Code: Select all

import "ecere"

class Form1 : Window
{
   text = "改变背景颜色";
   background = activeBorder;
   borderStyle = sizable;
   hasMaximize = true;
   hasMinimize = true;
   hasClose = true;
   size = { 400, 288 };
   anchor = { horz = -83, vert = -39 };

   Button button8
   {
      this, text = "还原", position = { 312, 48 };

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         this.background=activeBorder;
         return true;
      }
   };
   Button button7 
   {
      this, text = "退出", size = { 98, 21 }, position = { 152, 224 };

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         this.Destroy(0);
         return true;
      }
   };
   Button button1
   {
      this, text = "红色", foreground = red, position = { 120, 88 }, isRadio = true;

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         this.background = red;
         return true;
      }
   };
   Button button2 
   {      
      this, text = "绿色", foreground = green, position = { 120, 128 }, isRadio = true;

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         this.background = green;
         return true;
      }
   };
   Button button3 
   {      
      this, text = "蓝色", foreground = blue, position = { 120, 176 }, isRadio = true;

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         this.background = blue;
         return true;
      }
   };
   Button button4 
   {      
      this, text = "黄色", foreground = yellow, position = { 216, 88 }, isRadio = true;

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         this.background = yellow;
         return true;
      }
   };
   Button button5 
   {      
      this, text = "紫色", foreground = purple, position = { 216, 128 }, isRadio = true;

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         this.background = purple;
         return true;
      }
   };
   Button button6 
   {      
      this, text = "白色", foreground = white, position = { 216, 176 }, isRadio = true;

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         this.background = white;
         return true;
      }
   };
   Label label1 { this, text = "选择背景颜色", size = { 100, 13 }, position = { 144, 48 } };
}

Form1 form1 {};
Post Reply