Similar Threads
1. MSHTML and IHTMLDocument2 and "A Runtime Error has occurred"
I'm writing code to parse a specific website and decided to use MSHTML to
help (instead of regular expressions). The parsing code is complete - looks
very nice if I say so myself. :-)
The problem I have is setting up the doc itself. Here is a code snippet of
where the problem shows up:
FileStream file = new FileStream("c:\\day.html",
FileMode.OpenOrCreate, FileAccess.Read);
StreamReader sr = new StreamReader(file);
string html = sr.ReadToEnd();
IHTMLDocument2 doc2 = new HTMLDocumentClass();
doc2.write(html);
doc2.close();
I'm reading from a file in this stage of development. I simply went to the
site, did "view source" and saved it. I'll handle logging into the
site/etc. after I fix this.
The doc2.write(html) causes the familiar dialog box:
Error
A Runtime Error has occurred.
Do you wish to Debug?
Line: 16
Error: Object expected
<yes> <no>
I know I can turn that off, but my concern is "why is that happening"? I'm
90% sure it's because there is script code in the html. I am perfectly fine
having the script code NOT execute. The html I care about doesn't rely on
it. I don't want to force users of my code to have to turn off that dialog.
I'd rather have the dialog not come up. The doc object contains the correct
content and other than having to press the no button everything works fine.
Any suggestions?
--GHS
2. mshtml.IHTMLDocument2 help needed - VB.Net
3. How to display properties like Dockpadding and Font in the Property Grid
4. Having Property Grid Display Properties from the Most Derived Class - .NET Windows Forms
5. Finding Grid Positions in a Property Grid
Hi there,
[reposted from microsoft.public.dotnet.framework.windowsforms]
In C Sharp, I want to find the Y position (center, or top and bottom would
do) of the individual rows of a PropertyGrid. Is that possible?
In other words, I want to be able to find out the Y position, relative to
the top left of either the PropertyGrid or its container, of the properties
listed, for each item listed, or even better for an individual item.
I did find I could do the following to get something :
Point p = new Point(0,0);
Control ctrl = propertyGrid1.GetChildAtPoint(p);
The ctrl returned is a restricted object of type
System.Windows.Forms.PropertyGridInternal.PropertyGridView
I'm currently poking around in that to see what I can find, but it's tricky,
and most of it is protected or internal code, and since it is restricted it
could change in the future, so hopefully someone has an idea or some
insight...
Thanks.
James CC
6. Suppressing Properties in Property Grid - CSharp/C#
7. Property Grid with Dynamic Property values at runtime
Hi
I am trying to allow my property grid have a property with the values are
dynamically generated at runtime
I can create a static list but not dynamic
Anyone have a suggestion or code sample on how to do this ??
Thanks
namespace MyReport{
class MyPropGrid
{
private string sTitle1 = "";
private string sTitle2 = "";
private string sLogo = "";
private int nTitleFontSz = 0;
private System.Drawing.Color cBackColor;
private bool bFreeze = true;
private bool bAlternateRow = true;
private System.Drawing.Color cAltRowColor;
private string _myProp = "entry1";
[Browsable(true)]
[DefaultValue("entry1")]
[CategoryAttribute("Data")]
[TypeConverter(typeof(MyConverter))]
public string MyProp
{
get { return _myProp; }
set { _myProp = value; }
}
}
public class MyConverter : StringConverter
{
public override bool GetStandardValuesSupported(ITypeDescriptorContext
context)
{
//true means show a combobox
return true;
}
public override bool GetStandardValuesExclusive(ITypeDescriptorContext
context)
{
//true will limit to list. false will show the list, but allow free-form
entry
return true;
}
public override System.ComponentModel.TypeConverter.StandardValuesCollection
GetStandardValues(ITypeDescriptorContext context)
{
return new StandardValuesCollection( new string[] { "entry1", "entry2",
"entry3" });
}
}
8. Incrementing Control properties in the property grid - CSharp/C#