Using Template For Client Forms
I'm on the right track?
1.Maybe i can use String Template or there are alternatives?
2.How can I attach a search on only some fields filled in forms, which will be stored in xml?
You can have make a base form and use it as a template for other forms by inheriting it rather than inheriting Form.
Base form:
public partial class BaseForm : Form
{
public BaseForm()
{
InitializeComponent();
}
protected virtual void closeButton_Click(object sender, EventArgs e)
{
this.Close();
}
}
Form you want to be based on template:
public partial class MainForm : BaseForm
{
public MainForm()
{
InitializeComponent();
}
}
Here's a larger example in VB http://www.java2s.com/Code/VB/GUI/InheritsfromBaseForm.htm
And some info about it from MS http://msdn.microsoft.com/en-us/library/aa983613(v=vs.71).aspx
精彩评论