2017-04-10 24 views
0

저는 C#을 처음 접했을 때 현재 툴바에서 현재 내가보고있는 페이지의 페이지에 따라 동작 할 작업을하려고합니다. . 여기 notebook.page.label (gtk #)에 따른 IF 문

내가 할 노력하고 무엇 :

protected void OnRefreshActionActivated (object sender, EventArgs e) 
{ 

    if (mynotebook.CurrentPage.Equals == pgMyNotebookPage) 
    { 
     lblMsg.Text = "You are viewing the first page"; 
    } 
    else 
    { 
     lblMsg.Text = "You are viewing the second page"; 
    } 

} 

그러나 나는이 작업을 얻을 수없는 것. 어떤 포인터?

+0

이 CurrentPage의'type'은 무엇인가 : 그것은 각 페이지는 0

이 작동 코드로 시작하는 번호를 할당하는 것이 밝혀졌다? 그것은 문자열입니까, 아니면 객체입니까 – LP13

+0

Notebook에있는 페이지입니다 (위젯입니다),이 컨텍스트에서 타입에 의한 의미가 확실하지 않습니까? – Chriswidell

답변

0

기독교

감사합니다, 나는 나에게 mynotebook.CurrentPage의 출력을 보여 주 messagedialog을 만들어이 문제를 해결했다.

protected void OnRefreshActionActivated (object sender, EventArgs e) 
{ 
    if (nbMain.CurrentPage == 0) 
    { 
      lblMsg.Text = "You are viewing the first page."; 

    } 
    else 
    { 
      lblMsg.Text = "You are viewing the first page."; 

    } 

}