|
Hi Friend,
Thank you,
I am using web browser control, in windows application,
so i get all the HtmlElement like body,form,div etc...
from there i want to attache this.
have a look at my code
mshtml.IHTMLElementCollection ecol = document.all;
if (ecol != null)
{
foreach (IHTMLElement elmnt in ecol)
{
string str = elmnt.outerText;
int k = 0;
if (elmnt.ToString() == "mshtml.HTMLHeadElementClass")
{
mshtml.IHTMLHeadElement head = (mshtml.IHTMLHeadElement)elmnt;
mshtml.IHTMLScriptElement element = (mshtml.IHTMLScriptElement)document.createElement("script");
element.text ="function EventRaise(){var m = document.activeElement.value;alert(document.activeElement.type);alert('The active element is '+m); }";
IHTMLDOMNode node = (IHTMLDOMNode)element;
document.appendChild(node);
}
else if (elmnt.ToString() == "mshtml.HTMLBodyClass")
{
}
}
}
i hope you may have some idea on that...
awaiting...
|
|
|
|
|
|
That image is very small, and i'm not sure i understood your question.
|
|
|
|
|
I may be wrong, but I don't think VS uses a rich text control. I would draw the text myself, especially for such a specific interface and I would expect MS to do the same.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
|
Yes, I understood that from your original post. You want collapsable regions similar to that implemented in VS.
You will have to code that yourself. There is nothing in the standard toolbox which will do it for you. Look at the Paint event, MeasureText, and DrawText for starters. Be aware, it won't be a trivial task...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi. plz show a sample for me .
|
|
|
|
|
|
ShaktisinhRathod wrote: I am Facing a problem in Word.Document.SaveAs(,)
It Shows Error "No overload for method 'SaveAs' takes '11' arguments"
when I run application on OTHER MACHINE which also using Office2003.
Same Applicaiton works On My machine with 16 arguments
Have you checked you are supplying 16 arguments? Beacuse the error says 11, and the compiler can normally count pretty well...
BTW: when I have to supply lots of arguments to a method, I tend to put them each on a separate line - it make identifying which is which a lot easier, and you can also comment them:
aDoc.SaveAs(ref destFile,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1,
ref missing1);
missing1);
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
|
Check your references.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
|
Ah! So you created an application on one pc, and moved the .EXE file to another. When you run the application on the second PC, you get a run time exception "System.MissingMethodException: Method not found" or similar? Is this the correct sequence of events?
Have you installed Word on the second PC, and is it the same version?
Did you copy the EXE with a proper setup, or what?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
is there a way to do this in c#, i knew a way in c++, but all my searches have come to nothing, basically i am string the type of the class i am using in an xml file and trying to setup the exact type of class from the information stored in the xml file.
There has to be a way to do this as the xmlserialiser is able to do it/
|
|
|
|
|
|
Well, if I understood correctly what you need, the xml serializer is able to create a class from an xml document, but you need to know the class type.
If you have the class type name in a string, you can use Type.GetType to get the corresponding type object.
|
|
|
|
|
yeah i know that i am makin my own custom class serialiser, and am already referencing the GetType method from the class, what i weant to do is when i read the xml file and get the class type is to initialise the class from the class type (confusing i know)
|
|
|
|
|
The easiest way should to load the file using XmlDocument and get the type value from the corresponding node.
Then load the type and use it to initialize the serializer.
|
|
|
|
|
i still don't think you understand what i mean, oh well my fault, i found a way to to do it eventually, if you use Activator you can initialise an object of any class type by passing in the Type into the CreateInstance method like this:
Activator.CreateInstance(Type type)
|
|
|
|
|
Oh, now I've understood, you didn't wanted to use XML serialization, but to replicate it.
Sorry if I wasn't more useful, I'm glad you found a solution anyway.
|
|
|
|
|
i am new on C# and i need some help about arraylist argument out of exception problem please help me
and these are my codes ;
in Form1.cs;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
buton bt = new buton();
bt.kayit(@"C:\Users\Casper\Desktop\a.txt", textBox1.Text);
}
public void button2_Click(object sender, EventArgs e)
{
buton bt = new buton();
textBox2.Text = bt.okuyucu(@"C:\Users\Casper\Desktop\a.txt");
}
private void button3_Click(object sender, EventArgs e)
{
buton bt = new buton();
bt.silgi(@"C:\Users\Casper\Desktop\a.txt", Convert.ToInt16(textBox3.Text));
}
}
}
in buton.cs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace WindowsFormsApplication3
{
class buton
{
int counter = -1;
List<string> silici = new List<string>();
public string okuyucu(string path)
{
string a = string.Empty;
StreamReader okuyucu = new StreamReader(path);
a = okuyucu.ReadToEnd();
okuyucu.Close();
return a;
}
public void kayit(string path, string text)
{
counter++;
string okur = string.Empty;
StreamReader okuyucu = new StreamReader(path);
okur = okuyucu.ReadToEnd();
okuyucu.Close();
StreamWriter yazıcı = new StreamWriter(path);
silici.Add(text);
yazıcı.WriteLine(okur + text);
yazıcı.Close();
Console.WriteLine(silici.Count);
}
public void silgi(string path, int silineceksirasi)
{
Console.WriteLine(silici.Count);
silici.RemoveAt(silineceksirasi); ----> I GET MİSTAKE WHEN ı CLİCK BUTTON3!!!
StreamWriter deleter = new StreamWriter(path);
deleter.Dispose();
deleter.Close();
for (int k = 0; k <= silici.Count - 1; k++)
{
string okur = string.Empty;
StreamReader okuyucu = new StreamReader(path);
okur = okuyucu.ReadToEnd();
okuyucu.Close();
StreamWriter yazıcı = new StreamWriter(path);
yazıcı.WriteLine(okur + silici[k]);
yazıcı.Close();
}
}
}
}
THANKS FOR YOUR HELPS 
|
|
|
|
|
Hi,
Please keep in mind for the next post.....
Enclose the code within the code and pre tags, this makes it much easier to read.
Example:
public void kayit(string path, string text)
{
counter++;
string okur = string.Empty;
StreamReader okuyucu = new StreamReader(path);
okur = okuyucu.ReadToEnd();
okuyucu.Close();
StreamWriter yazıcı = new StreamWriter(path);
silici.Add(text);
yazıcı.WriteLine(okur + text);
yazıcı.Close();
Console.WriteLine(silici.Count);
}
Many thanks
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: code and pre tags
just PRE tags will do, it does not make sense to nest CODE and PRE tags; it may have had some use long ago, it does not today.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
|
My guess is that you have a number in textBox3 that is less than zero or equal to or greater than the .Count of your "silici" List . If you try to remove something at an index that doesn't exist the ArgumentOutOfRangeException is thrown. What is the value of "silineceksirasi" when you reach the silici.RemoveAt(silineceksirasi); statement? Make sure it's not equal or greater than the List.Count . Good luck!
PS. Please use pre tags when posting code.
|
|
|
|