public class KeyRecord
{
public TextBox RTB1{get;set;} ;
public KeyRecord(TextBox RTB1)
{
this.RTB1=RTB1;
}
}
uj5u.com熱心網友回復:
對建構式沒有深入了解,我直接套進去了,運行結果不對。還是我套用的不對?
public class KeyRecord
{
public List<string> _Record = new List<string>();
public TextBox RTB1 { get; set; }
public KeyRecord(TextBox RTB1)
{
this.RTB1 = RTB1;
}
public class KeyRecord
{
public TextBox RTB1{get;set;} ;
public KeyRecord(TextBox RTB1)
{
this.RTB1=RTB1;
}
}
對建構式沒有深入了解,我直接套進去了,運行結果不對。還是我套用的不對?
public class KeyRecord
{
public List<string> _Record = new List<string>();
public TextBox RTB1 { get; set; }
public KeyRecord(TextBox RTB1)
{
this.RTB1 = RTB1;
}
public class KeyRecord
{
public TextBox RTB1{get;set;} ;
public KeyRecord(TextBox RTB1)
{
this.RTB1=RTB1;
}
}
對建構式沒有深入了解,我直接套進去了,運行結果不對。還是我套用的不對?
public class KeyRecord
{
public List<string> _Record = new List<string>();
public TextBox RTB1 { get; set; }
public KeyRecord(TextBox RTB1)
{
this.RTB1 = RTB1;
}
public class KeyRecord
{
public List<string> _Record = new List<string>();
//public TextBox RTB1 { get; set; }
//public KeyRecord(TextBox RTB1)
//{
// this.RTB1 = RTB1;
//}
public RichTextBox RTB1 = new RichTextBox();
如果重新實體化一個文本框,就能在這個文本框里正常運行,
uj5u.com熱心網友回復:
RTB1有沒modifier屬性? 改為public試試
uj5u.com熱心網友回復:
你那個 Hook。。。 與類不相干,先要取得 ToolStrip。。。 類
uj5u.com熱心網友回復:
RTB1有沒modifier屬性? 改為public試試
已經設定過了
uj5u.com熱心網友回復:
你那個 Hook。。。 與類不相干,先要取得 ToolStrip。。。 類
public WDF1()
{
InitializeComponent();
KeyRecord kr = new KeyRecord();
kr.Start(); <<<<<<<<<<<<<<<<<<<<<這里開始呼叫的
***********************
public void Start()
{
if (hKeyboardHook == 0)
{
KeyboardHookProcedure = new HookProc(KeyboardHookProc);
**************************
uj5u.com熱心網友回復:
弱弱的看著,想幫助你但奈何我看不懂
uj5u.com熱心網友回復:
這里妹子少,帥哥也沒用
uj5u.com熱心網友回復:
<script>
</script>
uj5u.com熱心網友回復:
<script>
</script>
uj5u.com熱心網友回復:
湊湊熱鬧湊湊熱鬧
uj5u.com熱心網友回復:
這是你自己的定義的控制元件,可以用建構式傳遞到新的類使用
uj5u.com熱心網友回復:
666666
uj5u.com熱心網友回復:
namespace keyrecord
{
public partial class WDF1 : Form
{
public static RichTextBox RTB;//定義變數
public WDF1()
{
InitializeComponent();
RTB = RTB1; // 構造時參考;
KeyRecord kr = new KeyRecord();
kr.Start();
}
public void Form1_Load(object sender, EventArgs e) {}
public class KeyRecord
{
public RichTextBox RTB1 = RTB; //然后RTB1在外面里面都可以用了
}
}