用画图工具画一个流程图,然后把主窗口的背景图设置为这个流程图,
然后在这个流程图片的某个位置上放按钮。可是当主窗口的大小变化时,这个按钮却对不上原来在流程图上的位置,
如何做啊,急啊。
按钮上有个属性:Anchor 可以设置为:Left 这类的,但不起效果。

解决方案 »

  1.   

    最简单的是设置dock属性最笨的方法是重载OnResize()函数,在这个里面计算出Button的位置,然后设置Button的Location属性
      

  2.   

    你能换一句话吗?
    C# 控件相对于Form位置不变 1.保存控件的原先坐标 
    private void ResizeInit(Form fr){    foreach (Control ctrl in fr.Controls)    {        ctrl.Tag = ctrl.Left.ToString()+" "+ctrl.Top.ToString();    }          } 1.计算Form改变前与改变后的比例 
    Form的原先大小
     fPreSize[0] = (float)this.Width;fPreSize[1] = (float)this.Height; 改变Form的大小
      this.WindowState = FormWindowState.Maximized;this.Width = Screen.PrimaryScreen.WorkingArea.Width;this.Height = Screen.PrimaryScreen.WorkingArea.Height; Form改变的比例
     fNowSize[0] = (float)this.Width / fPreSize[0];fNowSize[1] = (float)this.Height  / fPreSize[1];  3.改变控件位置private void ResizeForm(Form fr){    int left, top;    foreach (Control ctrl in fr.Controls)    {        string [] sp = new string[1]{" "};        string [] pos =((string)ctrl.Tag).Split(sp, StringSplitOptions.RemoveEmptyEntries);        left = Convert.ToInt32(pos[0]);        top = Convert.ToInt32(pos[1]);        ctrl.Left = (int)(left * fNowSize[0]);        ctrl.Top = (int)(top * fNowSize[1]);    } }
      

  3.   

    界面如何控制type=button在td标签中的位置呢??