By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,158 Members | 1,385 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,158 IT Pros & Developers. It's quick & easy.

Programmatically get printPreviewDialog on a windows form

P: n/a

I have a windows form, there are button , textbox label etc. controls
on it. and i can programmatically get each of their names. and i also
have a printPreviewDialog on a form.
I cannot get it through loop.
i know that it does not have an appearance.
so - how can i get it programmatically ?

private void button1_Click(object sender, EventArgs e)
{
this.listBox1.Items.Clear();
ApplySomething(this);
}

internal void ApplySomething(Control c)
{
try
{
this.listBox1.Items.Add(c.Name);
if (c.HasChildren)
{
foreach (Control childControl in c.Controls)
{
ApplySomething(childControl);
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
Feb 2 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I think i can reach via reflection.
Cause printPreviewDialog is not a control , a member.

On Fri, 02 Feb 2007 14:22:58 +0200, inpuarg <in*****@whereland.com>
wrote:
>
I have a windows form, there are button , textbox label etc. controls
on it. and i can programmatically get each of their names. and i also
have a printPreviewDialog on a form.
Feb 2 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.