国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

NeoSwiff的圖像按鈕

2024-07-21 02:24:04
字體:
來源:轉載
供稿:網友
中國最大的web開發資源網站及技術社區,

最近研究了一下neoswiff的sdk.能寫出flash的c#語法編譯器,太強了!! 他的獨立ide安裝文件只有3m.
懷疑是不是有公開的c# 語法分析器......
作者對.net framework很熟悉.雖然它的gdi+與.net略有不同.
我用一個imagebutton擴展system.windows.forms.button控件小試了一下

//imagebutton.ccs
using system;
using system.drawing;
using system.collections;
using system.componentmodel;
using system.windows.forms;

namespace component
{  
  public class imagebutton : button
  {
    private image image = null;
    private string imagename = "";
   
    public imagebutton()
    {
      initializecomponent();
    }
   
    private void initializecomponent()
    {
      this.size = new size(25,25);
    }
   
    public string imagename
    {
      get { return imagename;}
      set { imagename = value;}
    }
   
    protected override void onpaint(painteventargs e)
    {
      this.visual.clear();
      this.visual.clearstroke();
      visual v = new visual(this.visual);
      image = new image(v,imagename);
      v.x = (width - v.width)/2;
      v.y = (height - v.height)/2;
     
      base.onpaint(e);
    }
  }



//form1.ccs
using system;
using system.drawing;
using system.collections;
using system.componentmodel;
using system.windows.forms;

namespace component
{
public class form1 : system.windows.forms.form
{
  private imagebutton button1 = null;
  private label lbl = null;
public form1()
{
initializecomponent();

//
// todo: add constructor logic here
//
   this.backcolor = color.whitesmoke;
}

private void initializecomponent()
{
this.button1 = new imagebutton();
   this.lbl = new label();
this.suspendlayout();
//
// button1
//
this.button1.location = new system.drawing.point(50, 50);
this.button1.imagename = "book";
   this.button1.click += new eventhandler(this.button1_click);

   //
   // lbl
   //
   this.lbl.location = new point(40,100);
   this.lbl.visible = false;
   this.lbl.text = "appear!!";
  
//
// form1
//
this.controls.add(this.button1);
   this.controls.add(this.lbl);
this.text = "form1";
this.resumelayout(false);
}
 
  public void button1_click(object sender, eventargs e)
  {
    this.lbl.visible = ! this.lbl.visible;
  }
 
static void main()
{
//
// todo: add application logic here
//
application.run( new form1() );
}
}
}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 白城市| 新化县| 巨鹿县| 朝阳区| 鲁甸县| 万荣县| 华安县| 涡阳县| 运城市| 全南县| 昌平区| 息烽县| 美姑县| 峨边| 玉门市| 东海县| 缙云县| 商都县| 荣成市| 嘉禾县| 苗栗县| 新和县| 达孜县| 海兴县| 肥东县| 嘉善县| 旌德县| 洱源县| 沁源县| 河北省| 白水县| 监利县| 卓尼县| 岚皋县| 西林县| 临沧市| 黑龙江省| 鲁山县| 佳木斯市| 个旧市| 福鼎市|