|
tried using tapPage.Hide() but it has no effect, tab page still displays... I'm wanting to show a tabPage2 only when there are processing errors on tabPag1. Is there another way, or a way to dynamically add a tab page to a tab control...???
thanks,
vince
|
|
|
|
|
If the TabControl is named "tabControl" , the code for closing is :
// verify if the TabPages exist
// if we try to close a non-open tab will have error's
if (this.tabControl.TabPages.Count != 0)
this.tabControl.TabPages.Remove(this.tabControl.SelectedTab);
//SelectedTab is the selected tab tabControl.TabPages[<number>] is the
//<number> tab , if you whant other tab
|
|
|
|
|
thanks for the reply, but that's not quite what I'm looking for... I need to have either a hidden tab page that can be unhidden, or the ability to create a tab page with a listbox containing error strings...
Don't need to remove a tab page...
thanks for any further suggestions..
|
|
|
|
|
vlusardi wrote:
or a way to dynamically add a tab page to a tab control...???
Sure, try something like this, it works:
for(int i = 0; i < 5;i++)
{
TabPage tbpage = new TabPage("test" + i);
this.tabControl1.TabPages.Add(tbpage);
}
-Nick Parker
|
|
|
|
|
I'm building a set of custom controls. I would like the controls to act as parents for controls dropped on them in the forms editor. I could use .Panel as the parent type but that would preclude visual editing in the IDE ( why ? ).
Looking at UserControl in the object browser I see that it is indeed a container and implements the IContainer interface somewhere down in the inheritance diagram. However, if I drop a UserControl into a form then drop another UserControl on top of it the forms editor will make the form the parent of both. This is different than if I drop the second UserControl on a panel or groupbox.
How do I make my controls act like a panel/groupbox in this respect ?
Duncan Meech
dmeech@riverdeep.net
|
|
|
|
|
Answering myself.....add this class to your controls base class.
///
/// Provides Base class designer support.
///
public class YourBaseClassControlDesigner : System.Windows.Forms.Design.ParentControlDesigner
{
// add whatever filters you like to determine the types of controls you can parent
public override bool CanParent(Control c)
{
return true;
}
public override bool CanParent(ControlDesigner cd)
{
return true;
}
}
then add these attributes to your actual control...
[Designer(typeof (YourBaseClassControlDesigner))]
public class YourBaseClassControl : System.Windows.Forms.UserControl ...
Duncan Meech
dmeech@riverdeep.net
|
|
|
|
|
Hi everyone,
I would like to create a control able to reproduce the navigation bar of Windows XP. I do not want to simulate what the original control does, I would like to exploit what Windows XP does (as I can do with every common controls). What kind of control is the original navigation bar?
Thanks in advance for your attention
Marco Losavio
|
|
|
|
|
I'd heard that vs2003 was going to bring significant changes, but aside from compact framework i dont see anything.
wasnt there supposed to be new tools supporting events?
wasnt there supposed to be C# templates or new typesafe tools?
am i missing something?
thanks!
|
|
|
|
|
I haven't seen VS 2003. But it's largely a bug-fix release.
C# templates won't appear until at least .NET 2
Kevin
|
|
|
|
|
|
Well, hopefully they'll be rather more timely with service packs going forward, unlike for VS 2002!
Kevin
|
|
|
|
|
Kevin McFarlane wrote:
Well, hopefully they'll be rather more timely with service packs going forward, unlike for VS 2002!
Hmm... I don't think so. My impression is that starting with VS.NET 2002 they stopped "losing time" supporting the IDE by itself, and were working only on VS 2003. They did support the framework, but the IDE fixes were only be available if you upgrade (ok, it's cheap). I think that will be the case when Whidbey comes out: there will be one or two SP for .NET Fx 1.1, but not for the IDE.
Specially because it will be tightly integrated with Yukon, this would be a great push for the new SQL Server.
My latest article: GBVB - Converting VB.NET code to C#
|
|
|
|
|
Daniel Turini wrote:
but the IDE fixes were only be available if you upgrade (ok, it's cheap)
According to the original roadmap MS will release an SP for VS.NET 2002 for those who choose not to upgrade.
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
The beef is in the Visual C++.NET side of things. Windows Forms editor, 97% ISO Compliance, etc.
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
I hope that you only paid the upgrade price of $29 for it.
You get .NET framework 1.1 and SDK, but of course you can get that for free online. As well as the compact frameworks SDK.
For C#, you get some extra intellisense, but little else.
For C++ users, this is a fairly significant upgrade such as language improvements and WinForms designer support.
Thanks, Wes
|
|
|
|
|
Back about a month ago, I was doing some searching and found a nice, easy way to write strings to the browser control. I vaguely remember it used HTMLDocument2(?) as the vehicle. Anyway, once I found it I put the code into my project and tested it to make sure it worked. And it did.
Now my problem is that Desktop Management -- in giving me my new laptop -- supposedly pulled off all of my current work and moved it to my new machine. But looking at the code it looks like they gave me a version after I had gotten that code snippet!!!!! Worse yet, I cannot recreate the search I did to get the code snippet found again!!! Arrrrggggghhhh.
Is anyone familiar with the code for doing a write to the browser control??? I have seen other examples of this but it requires hooks off events from the browser and other complex steps that make very ugly and unpredictalbe to deploy. I vaguely recall the code was something like this....but I can't make it work right:
string url = "about:blank";
object o = System.Reflection.Missing.Value;
this.showWebPage.Navigate(url, ref o, ref o, ref o, ref o);
ICustomDoc cDoc = (ICustomDoc)this.showWebPage.Document;
cDoc.SetUIHandler((IDocHostUIHandler)this);
HTMLDocument2 wDoc = (HTMLDocument2) this.showWebPage.Document;
wDoc.write("this string");
Is anyone familiar with how to do this???
Thanks for any help!
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
wDoc.body.innerHtml = "this string";
This should be simple enough.
|
|
|
|
|
This failed. I am not correctly instantiating the browser document object.
I am getting it defined, but body is set to null.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
It's because the document object must be initialized first. This issue has been under scrutiny the last few days in this forum, and the answer is to call a method from an interface queried from the doc. It's IPersistStreamInit. And the method is InitNew(). Look up this forum with either of these keywords.
|
|
|
|
|
Rod,
Okay, I followed the discussion threads and got the document write working -- or at least that is how it appeared. I got the page displayed that I had passed via innerHTML.
However -- the previous discussion is related to acquiring / altering info on a browser page that had been navigated to. I am trying to have the browser show a functional page that was written to it as a string. A REALLY LONG string, but a string none the less.
I am speculating that since I am populating InnerHTML, it really is not being set up as a proper page within the document object. The string contains a full HTML document and it has script problems when I try to execute the script inside this 'page' since the browser indicates that all it contains is "about:blank"...even after I have updated the browser document object.
So this approach helped me create a visual, but it was only a painting of a "car" instead of a running, moving "car". I need to do a write to the document object to create a full HTML page that is executable in the browser as if it had navigated to a site. So using IPersistStreamInit does not really help me since it does not expose a doc.write method that supports a string as input, and updating doc.body.innerhtml does not create a functional webpage with scripts.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
quick facts :
- if you want the web browser to run in full extent, you need two main dlls : shdocvw.dll (IWebBrowser) and mshtml.dll (IHTMLDocument). By full extent, I mean that some of the Internet Explorer features are not available if only one of the two dlls are loaded. For instance, if you only load IHTMLDocument, then you can't navigate a url. At least you can't without a few tricks which, in the end, indirectly load shdocvw.dll behind the wheel.
- if you only load shdocvw.dll, then you have all Navigate(url) features, but you don't have access to the underlying dom.
- conversedly, if you only load mshtml.dll, you'll be able to build and traverse a dom, but won't be able to navigate a url, or even the web page represented by the dom.
- attaching one dll to the other is done by implicit or explicit query interfaces, and often involve IPersist**** interfaces.
Hope this clarifies things a bit.
|
|
|
|
|
To quote my dear mum -- it is clear as mud.
This is in an application where I am hooking IDocHostUIHandler and as such I have both DLL's loaded.
Now what is frustrating to me is that this article that WORKED before (the one I cannot recreate the search that found it earlier) did not use the IPersist*** interface to accomplish the task. But the nominclature required to create a working object within the browser is lost. In the example I had found earlier and cannot find now the example was explicitely to have a document be written to the browser as a string. And....in that article, after getting the document object created, he just did document.write(stringValue); The resulting page that was displayed in the browser control contained the display portions as expected AND the browser View Source contained ALL of the HTML that made up my string-based web page.
Deploying the IPersist*** approach displayed the page but when I View Source the browser knows nothing of my document -- only the about:blank document. And I DO have both DLL's in my program.
I hate working with the browser. It shouldn't have to be THIS hard.
Michael
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
theRealCondor wrote:
Deploying the IPersist*** approach displayed the page but when I View Source the browser knows nothing of my document -- only the about:blank document. And I DO have both DLL's in my program.
I have been explaining the cause of this effect in my previous post.
theRealCondor wrote:
document.write(stringValue);
That's javascript syntax. And that's a javascript context, where dlls mentioned earlier are loaded and appropriately attached for us.
None of this context is ready by default when you are custmizing the usage of the browser, especially with .NET languages which, as a matter of fact, only add another layer of code on top of it.
You need specific marshaling to do this using C# since the tlbimp importer generated a f***ed up signature for the write method.
|
|
|
|
|
.S.Rod. wrote:
document.write(stringValue);
That's javascript syntax. And that's a javascript context, where dlls mentioned earlier are loaded and appropriately attached for us.
You misunderstood my post. The example I found that actually worked was SOMETHING like this:
(somedoctype) document = (someInterfaceType) mybrowsercontrol.Document;
document.write(myString);
I vaguely recall that the document type was something like HTMLDocument2. And the working example was only 2 or three lines of code AND I did not remember using IPersist... in getting it implemented.
So anyway. I read your post and I don't understand any of it. Your suggestion just does not work the way I need it to work. Thanks anyway.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
theRealCondor wrote:
(somedoctype) document = (someInterfaceType) mybrowsercontrol.Document;
document.write(myString);
This method call cannot compile with the C# compiler. The C# signature awaits a String[].
|
|
|
|