在画面的初始化时,如何把把光标设置在需要设置的Button上,开发环境VC_MFC
谢谢!
在线等待!

解决方案 »

  1.   

    先得到button的指针
    然后调用SetFocus
      

  2.   

    to sal:
    如何得到button的指针
      

  3.   

    ((CButton *)GetDlgItem(IDC_BUTTON1))->SetFocus(),给分吧。
      

  4.   

    循环:
    #include"iostream.h"
    void main()
    {
    int n,f=2;
    do
    {
    cout<<"please input a positive integer:"<<endl;
    cin>>n;
    }while(n<0);
    if(n==0||n==1)
        f=1;
    else 
    {
    int a=1,b=1;
    for(int i=2;i<n;i++)
    {

    a=b;
    b=f;
    f=a+b;
    }
    }
    cout<<f<<endl;
    }
      

  5.   

    支持bit1010(于剑泉)我又来迟了
      

  6.   

    支持bit1010(于剑泉)我又来迟了
      

  7.   

    to:于剑泉
    循环:
    #include"iostream.h"
    void main()
    {
    int n,f=2;
    do
    {
    cout<<"please input a positive integer:"<<endl;
    cin>>n;
    }while(n<0);
    if(n==0||n==1)
        f=1;
    else 
    {
    int a=1,b=1;
    for(int i=2;i<n;i++)
    {

    a=b;
    b=f;
    f=a+b;
    }
    }
    cout<<f<<endl;
    }看不懂,啥意思啊,哥们????
      

  8.   

    ((CButton *)GetDlgItem(IDC_BUTTON1))->SetFocus(),MFC中我应该加在那里啊,老大,见笑了???
    麻烦指点。
    我的主窗体并没有main函数啊??????