471,594 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

Programmatically get printPreviewDialog on a windows form


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
1 1566
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.

Similar topics

2 posts views Thread by Michael A. Covington | last post: by
reply views Thread by Harry J. Smith | last post: by
5 posts views Thread by Carlo Marchesoni | last post: by
1 post views Thread by jacopomeucci | last post: by
2 posts views Thread by Richard MSL | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.