I am looking for a way to print and html page from an embeded web browser window. Is there an easy way to do this. I created the document because I did not want to go through all the trouble of designing my own print function to do every line and all the text on the page.
draco_iii
Posts
-
Printing a web page -
Problem with DataTableI am using MySQLDriverCS and I have a table I have gotten through the select command. When I try the following
foreach(DataRow myData in MyDataTable.Rows) { }
I throws an InvalidCastException in System.Data.dll I have even tried sending the rows to a DataRowCollection and it does the same thing when doing the foreach loop. I have checked HasErrors property and it is false. This is not making much sence to me. Anyone have any ideas. -
Loading a DLL DynamicallyI need to load DLLs only if they are in a directory. Is there a simple way to do this?
-
Counting New Lines in a StringActually the StringReader class will work better for what I want to do. Thanks for pointing me to it.
-
Counting New Lines in a StringI need to count the number of new lines(\n) in a string. I thought about using regular expressions, but I do not really understand them very well. .NET also does not provide a way to get this information. The only other way I can think of doing it is writing a function to count them through other string functions, if there is a faster or better way to do it I would really like to know.
-
Encrypting\DecryptingThe problem with the orginal code is I was not Seeking to the beginning of the stream.
-
Encrypting\DecryptingI am using the following to open and write and encryped datafile. FileStream fout = new FileStream(OptionsDataFile, FileMode.Create, FileAccess.Write); TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider(); CryptoStream encStream = new CryptoStream(fout, tdes.CreateEncryptor(new byte[] {22,184,62,104,66,100,202,17,91,254,197,181,224,62,36,138,128,227,146,111,134,83,241,125} ,new byte[] {216,237,102,42,142,11,133,104,}), CryptoStreamMode.Write); ASCIIEncoding AE = new ASCIIEncoding(); and the following to decrypt. FileStream fin = new FileStream(OptionsDataFile, FileMode.Open, FileAccess.Read); TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider(); CryptoStream encStream = new CryptoStream(fin, tdes.CreateDecryptor(new byte[] {22,184,62,104,66,100,202,17,91,254,197,181,224,62,36,138,128,227,146,111,134,83,241,125} ,new byte[] {216,237,102,42,142,11,133,104,}), CryptoStreamMode.Read); ASCIIEncoding AE = new ASCIIEncoding(); int tempByte = new int(); byte[] inBytes = new byte[(int)fin.Length]; encStream.Read(inBytes,0,(int)fin.Length); When it gets to the read I get the following. An unhandled exception of type 'System.Security.Cryptography.CryptographicException' occurred in mscorlib.dll Additional information: Bad Data. Anyone have any ideas why. Everything is the same for the write. I just do not get why the data would be bad.
-
checking time valuesI have three time values and they are in string format. string time1 = "12:00:00" string time2 = "12:30:00" string time3 = "13:00:00" time2 changes, but time1 and time3 stay the same How can I check to see if time2 is between time1 and time3? I have thought of several different ways but they are all lengthy and involved. I though maybe something like this would work but want to make sure it will always work. if(time1 <= time2 <= time3) { do such -n- such } will this work for strings
-
ListView getting the Selected ItemThis gives access to the "Selected Index". listView1.FocusedItem.SubItems[0]
-
Datatables and XMLHow can I write a Datatable to and XML file.
-
Open an "About" window....What exactly are you trying to do with the Click? Do you want to close the about window? about.ActiveForm.Hide() Is this where you are trying to open the about window? Form aboutForm = new about(); aboutForm.Show(); It depends on what file the aboutClick() is in.
-
Component AuthoringI wanted to thank you so very much. That was right on target, I had something very similar, but was missing the "enum" contructions that allowed it to work properly. Again, thank you very much, I searched for hours yesterday, but to no avail.
-
Component AuthoringWhile creating a web component I ran into a problem with setting the properties for the Designer Property Pages. One of my Properties can only be Top,Bottom,Left, or Right. I want these in a listbox on the property pages. I have hunted for a way to do this, but I have been unable to find anything remotely close to the subject.
-
Getting the HTML Page from an WebBrowser ComponentHow can I go about getting the HTML Page so that it can be parsed. I already have the AxSHDocVw.AxWebBrowser displaying the page, now I just need to get at the HTML code. ??????????
-
Accessing varibles across forms.Thanks. As soon as I got the space out of the name it worked perfectly. There needs to be a an article about making a static varible class. It is the best way I have seen to have global varibles.
-
how to get an object's values from other form ?That would depend entirely on exactly what you are trying to do. If the Object is a Control you have added to the form and you know the objects name. You can access the Controls properties and methods via
for(int i = 0; i == this.ParentForm.Controls.Count-1;i += 1){ //Perform actions on registered objects. if(this.ParentForm.Controls[i].Name == "ControlName"){ //Perform actions on control. } }
However, if you need to access varibles only, you should create a static class similar to this.using System; namespace staticTest { public class Setting{ public static String[] test = new String[10]; public static int[] testInt = new int[10]; static Setting(){ } } }
-
Accessing varibles across forms.Made the static class for the variable it look like this
using System; using Perpetual_Settings; namespace Brazen_Mail { /// /// Summary description for Setting. /// public class Setting { public static Perpetual_Settings.PerpetualSettings test = new PerpetualSettings(); static Setting() { test = new PerpetualSettings(); } } }
But when running the code I get this error.
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in system.windows.forms.dll
Additional information: File or assembly name Perpetual Settings, or one of its dependencies, was not found.
I can see the Properties and Methods from the class when trying access them via VS, but it craps out when I try and run the program.
-
Accessing varibles across forms.How do you go about letting them know about each others existance or at least letting the child forms see full existance of the main running form? I need to be able keep one set of the varibles not multiple instances so that they can be written to or read from by any of the child forms. Doing so, would allow less overhead and insure that all of the child forms are working from the same set of "settings".
-
Accessing varibles across forms.I have a varible that is declared in the main application form as public. How can I get at this varible from another form. I have tried accessing the forms varible via Form1.varible and this.ParentForm.varible and so forth. All to no avail and I need to have access to this varible from anywhere in the program. Any suggesttion would be greatly appreciated.
-
how can i move a rectangular from one position to anotherYou can do this by changing the Rectangle Draw points and then redraw the object.
Rectangle DrawRectangle = new Rectangle(4,4,50,50); private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { e.Graphics.DrawRectangle(System.Drawing.Pens.Beige, DrawRectangle); } private void button1_Click(object sender, System.EventArgs e) { DrawRectangle = new Rectangle(20,20,50,50); panel1.Invalidate(); }