Ecere SDK/eC Forums
https://ecere.org/community/
Print view

changebackcolor改变背景颜色
https://ecere.org/community/viewtopic.php?f=30&t=43
Page 1 of 1
Author:  liqi98136 [ Wed Mar 10, 2010 9:04 am ]
Post subject:  changebackcolor改变背景颜色

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 {};
All times are UTC-05:00 Page 1 of 1