Now Do I Emulate Foxpro Functionality In C#?

  • Thread starter Thread starter Steven C
  • Start date Start date
S

Steven C

Hello:

I am trying to do in C#, what I have done for years in Visual Foxpro.
I am trying to set up base form classes, so that I can inherit
behavior in child classes. Specificallly, I am trying to build a
navigation form base class, ie, a form with a SAVE and a CANCEL
commandbutton on it. The problem is, when I instantiate the form (The
SAVECANCEL form), I cannot see the commandbuttons:

What am I missing?

Thanks!

Steven



using System;
using System.Windows.Forms;
using C.Base.Controls;
using System.Drawing;

namespace C.Base.Forms
{
/// <summary>
/// Base Form Object For This Application.
/// </summary>
public class CBaseForm : System.Windows.Forms.Form
{
public CBaseForm()
{
this.Width = 600;
this.Height = 400;
this.BackColor = Color.LightBlue;

}
}
public class CSaveCancelForm : System.Windows.Forms.Form
{
public CSaveCancelForm()
{

CBaseCmdButton cmdSave = new

C.Base.Controls.CBaseCmdButton();
cmdSave.Left = 5;
cmdSave.Top = 5;
cmdSave.Text = "Save";
cmdSave.Visible = true;
CBaseCmdButton cmdCancel = new

C.Base.Controls.CBaseCmdButton();
cmdCancel.Left = 75;
cmdCancel.Top = 100;
cmdCancel.Text = "Cancel";
cmdCancel.Visible = true;
}
}
}
 
Hello:

I am trying to do in C#, what I have done for years in Visual Foxpro.
I am trying to set up base form classes, so that I can inherit
behavior in child classes. Specificallly, I am trying to build a
navigation form base class, ie, a form with a SAVE and a CANCEL
commandbutton on it. The problem is, when I instantiate the form (The
SAVECANCEL form), I cannot see the commandbuttons:

What am I missing?

Thanks!

Steven



using System;
using System.Windows.Forms;
using C.Base.Controls;
using System.Drawing;

namespace C.Base.Forms
{
/// <summary>
/// Base Form Object For This Application.
/// </summary>
public class CBaseForm : System.Windows.Forms.Form
{
public CBaseForm()
{
this.Width = 600;
this.Height = 400;
this.BackColor = Color.LightBlue;

}
}
public class CSaveCancelForm : System.Windows.Forms.Form
{
public CSaveCancelForm()
{

CBaseCmdButton cmdSave = new

C.Base.Controls.CBaseCmdButton();
cmdSave.Left = 5;
cmdSave.Top = 5;
cmdSave.Text = "Save";
cmdSave.Visible = true;
CBaseCmdButton cmdCancel = new

C.Base.Controls.CBaseCmdButton();
cmdCancel.Left = 75;
cmdCancel.Top = 100;
cmdCancel.Text = "Cancel";
cmdCancel.Visible = true;
}
}
}
Best I can tell you aren't actually adding the controls to the form. call
Add on the forms Controls property and add them.
 
Back
Top