471,330 Members | 1,220 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Any safe way to do this?

Joe
I need to some how add a page to a tabcontrol. The problem is I have a
single method to bring up the dialog which contains the tabcontrol and
doesn't return until the dialog is closed and I don't have any events for
it.

The only thing I can think of is to start a thread before calling that
method and use FindWindow to get a handle to the dialog and add a page that
way. But, this is not safe...

Any ideas?

-Joe
Jan 25 '06 #1
4 1086
Programmatically?

TabPage newPage = new TabPage("New Page");
tabControl1.TabPages.Add(newPage);

-- there are other properties of course that you can set too.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Joe" wrote:
I need to some how add a page to a tabcontrol. The problem is I have a
single method to bring up the dialog which contains the tabcontrol and
doesn't return until the dialog is closed and I don't have any events for
it.

The only thing I can think of is to start a thread before calling that
method and use FindWindow to get a handle to the dialog and add a page that
way. But, this is not safe...

Any ideas?

-Joe

Jan 26 '06 #2
Joe
I don't have direct access to the tabcontrol. I only have a single method to
call this dialog. The dialog is coming from a third party library.
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:22**********************************@microsof t.com...
Programmatically?

TabPage newPage = new TabPage("New Page");
tabControl1.TabPages.Add(newPage);

-- there are other properties of course that you can set too.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Joe" wrote:
I need to some how add a page to a tabcontrol. The problem is I have a
single method to bring up the dialog which contains the tabcontrol and
doesn't return until the dialog is closed and I don't have any events for
it.

The only thing I can think of is to start a thread before calling that
method and use FindWindow to get a handle to the dialog and add a page
that
way. But, this is not safe...

Any ideas?

-Joe

Jan 26 '06 #3
Ah, you didn't quite make that part clear in your post. Suggest reading the
vendor's documentation carefully.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Joe" wrote:
I don't have direct access to the tabcontrol. I only have a single method to
call this dialog. The dialog is coming from a third party library.
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:22**********************************@microsof t.com...
Programmatically?

TabPage newPage = new TabPage("New Page");
tabControl1.TabPages.Add(newPage);

-- there are other properties of course that you can set too.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Joe" wrote:
I need to some how add a page to a tabcontrol. The problem is I have a
single method to bring up the dialog which contains the tabcontrol and
doesn't return until the dialog is closed and I don't have any events for
it.

The only thing I can think of is to start a thread before calling that
method and use FindWindow to get a handle to the dialog and add a page
that
way. But, this is not safe...

Any ideas?

-Joe


Jan 26 '06 #4
Hi Joe,
Welcome to MSDN Newsgroup!

Based on my experience, the best solution for this issue is to modify the
source code of dialog and add the specified code to add page to TabControl.
So I want to confirm whether or not you have this dialog's source code. If
not, I think there may be no safe way to do this except the hacking way,
just like using a thread to get dialog's handle.

I hope the above information is helpful for you. If you have any questions,
please feel free to let me know. Thanks and have a nice day!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
From: "Joe" <jb*******@noemail.noemail>
References: <#$*************@TK2MSFTNGP10.phx.gbl> <22**********************************@microsoft.co m>Subject: Re: Any safe way to do this?
Date: Wed, 25 Jan 2006 20:07:33 -0500
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <#8**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.windowsforms,mic rosoft.public.dotnet.langu
ages.csharpNNTP-Posting-Host: 69.37.58.70.adsl.snet.net 69.37.58.70
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.csharp:381305
microsoft.public.dotnet.framework.windowsforms:934 56X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

I don't have direct access to the tabcontrol. I only have a single method tocall this dialog. The dialog is coming from a third party library.
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:22**********************************@microso ft.com...
Programmatically?

TabPage newPage = new TabPage("New Page");
tabControl1.TabPages.Add(newPage);

-- there are other properties of course that you can set too.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Joe" wrote:
I need to some how add a page to a tabcontrol. The problem is I have a
single method to bring up the dialog which contains the tabcontrol and
doesn't return until the dialog is closed and I don't have any events for it.

The only thing I can think of is to start a thread before calling that
method and use FindWindow to get a handle to the dialog and add a page
that
way. But, this is not safe...

Any ideas?

-Joe



Jan 26 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by steve | last post: by
18 posts views Thread by srijit | last post: by
42 posts views Thread by Irmen de Jong | last post: by
2 posts views Thread by qazmlp | last post: by
2 posts views Thread by Lou | last post: by
2 posts views Thread by Darren Clark | last post: by
1 post views Thread by jecheney | last post: by
4 posts views Thread by George2 | last post: by
reply views Thread by rosydwin | 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.