|
Hi everyone,
I was wondering if anyone's worked with the WebBrowser control and the MSHTML library using element events. I'm trying to hook an HTMLElement onclick event after a document page loads but I can't seem to figure out what c# expects us to do.
I tried this to no avail along with a couple of other approaches
using MSHTML;
class
{
...
protected IHTMLElement elem;
protected bool OnHtmlElementClick(IHTMLEventObj sender)
{
MessageBox.Show("Got it!!");
return true;
}
webcontrol_NavigateComplete2()
{
elem = GetElementFromDocument();
elem.onclick =
new HTMLElementEvents2_onclickEventHandler(this.OnHtmlElementClick);
elem.click(); // force a test
}
}
Steve A
B.Eng, MCSD, MCSE, MCDBA
Senior Software Developer
Optimal Robotics Corporation
|
|
|
|
|
Hi ,
do you have the answer ??
|
|
|
|
|
Sorry for the cross post but I cant get much of a response from the C# forums that I know about. Heres the copy and paste from the codeguru forum:
Has anybody seen an example of this or any of the other C# encryption classes? The documentation seems to assume you are familiar with the topics and never lists an example.
Basically I'm looking for an algorithm that will generate a key based on a password and user id. It doesnt have to be the best security but I would rather use a built in algorithm rather than constructing my own.
TIA
|
|
|
|
|
i want to get file information such as it's icon,size,path etc.
i don't how to get the icon information,i think should use
import shell32.dll to do it,because there is a SHGetFileInfo
Function which can Get the file's Icon Information,but I don't
know how to invoke it,if you could do it,please don't hesitate
to help me,thanks
i need an example code of how to use SHGetFileInfo in c#,thanks
|
|
|
|
|
Hi,
I'm trying to write something like a "pipe" function for some streaming code I'm writing. What I want to write is a function that can "preview" a stream, making a new one if necessary. It'll have to return the same type as it takes. e.g. for a function:
bool Something( StreamReader r ) { ... }
I could call it as either:
Something( r );
Or (using the pipe command )
Something( CountStream( r ) );
I've written the following, but get an exception whilst trying to new up the "output" stream:
private static System.IO.Stream CountStream( System.IO.Stream r )
{
// Following give compile error
// System.IO.Stream w = new System.IO.Stream(r);
// Following give runtime error (and isn't exactly what I want)
System.IO.StreamReader w = new System.IO.StreamReader(r);
int nByte = r.ReadByte();
while ( nByte != -1 )
{
m_nCount++;
nByte = r.ReadByte();
}
return w.BaseStream;
}
I'm using "System.IO.Stream" since it forms the base class, ideally I'd like to be able to pass in any "System.IO.Stream" type.
Am I chasing up the wrong alley?
Regards,
Ray
|
|
|
|
|
I am programming in ASP.NET and C#. I was trying to retrieve the event log information from a remote machine in my code using the EventLog class from .NET Framework. It throws an Unauthorized access exception when I try to get event log information of any remote computer. Though, I am able to access these event logs through Event Viewer. I was researching on the web and I read that I need registry rights to that remote machine. Does anyone know about this or has anyone tried this before?
|
|
|
|
|
I'm working on a project now that does that and I'm able to do it. The domain account I'm using to access the remote computer is a member of the Administrator group on the remote machine. I don't know what registry rights are but I assume Admin rights cover that.
Maybe you have some kind of read-only rights to the remote registry? I haven't seen this problem before so I don't know what would cause it.
Craig Dodge
A catchy signature should appear here.
|
|
|
|
|
But, you didn't wrote, how you achieve your work...
Thanks,
Chintan(India)
|
|
|
|
|
Hi,
on my textBox1_KeyUp event i only want to accept numeric keys, i.e., i'll only accept 0,1,2,...9. Letters and others keys will not be accepted.
Example: supose tha i wrote 123asd
i want that
textBox1.Text = 123 instead of textBox1.Text = 123asd.
My problem is that i can't do e.KeyValue = 0 ,because e.KeyValues is readonly. To e.KeyCode and e.KeyData it's the same.
Anyone knows how to solve this problem??
Thanks
Carlos Lopes
|
|
|
|
|
Is it possble to instantiate a COM object written in C# from a standard MFC app written in VC6?
ps I have only been C# for 1 day - and I have managed to implement a plugin interface that I use for VB and ATL objects and I was investigating whether we could also use C# et al
Holy Handgrenade of Antioch instructions
|
|
|
|
|
Hi CodeProject,
I have created a form with a datagrid, my requirement is that when
the user clicks "F5" I want to update a certain column with the current
time.
I defined a DataGridTableStyle and a DataGridTextBoxColumn object. I
attached an event handler to the DataGridTextBoxColumn.TextBox.KeyUp
property.
So now when I hit "F5" the column is updated, but alas, as soon as I
navigate to a different line, the row disappears! Am I doing something
wrong, or is this a bug? Maybe someone has an different way of doing this?
Anyways, this is my code for the KeyUp event:
private void dataGridColumn1_TextBox_KeyUp(object sender, KeyEventArgs kea)
{
if (kea.KeyCode == Keys.F5)
{
DataRowView drv = (DataRowView)dataGrid1.BindingContext
[dataGrid1.DataSource].Current;
drv["Col1"] = DateTime.Now.ToLongTimeString();
}
}
Thanks
|
|
|
|
|
Do you know where can I get a source code of any proxy server, working under Windows writen in C/C++??? I need it so!!! Thanks in advance.
|
|
|
|
|
System.winforms isn't there. I can access forms through System.Windows.Forms.Form but all the books I read and examples I see are using Winforms??? Is there something I am missing?
MS all the way!
|
|
|
|
|
System.winforms was renamed to System.Windows.Forms in Beta 2
Some of the examples haven't caught up yet...
|
|
|
|
|
Thanks...Does anyone know of a good reference online for the classes and what is in them?
|
|
|
|
|
Hi, i've got a little problem when trying to change a datarow caption property.
Lets say that i've :
- one DataTable named dTable;
- the DataTable as 4 DataColumns;
- supose that dTable.Columns[0].ColumnName="CodTerc"
and i do:
dTable.Columns[0].Caption = "Código";
After doing this i expected that my Grid has the first column caption = "Código", but unexpectedly the caption ="CodTerC".
I know that by default datarow caption= datarow columnName, but when i change caption i expect that my grid shows the caption not the ColumnName.
If someone has an answer for this please say something.
Thanks
Carlos Lopes
|
|
|
|
|
does anyone have example of fsream code?
|
|
|
|
|
I have written a C# component that I use in ASP and in ASP I use a
recordset which I would like to give to along as a parameter with a method
from my C# component. How do I handle this ? How can I read that recordset
and what type of variable or object must the parameter be of my c# method.
Any one ?
Thanks
Thomas
|
|
|
|
|
|
Hi, i've got a little problem when trying to change a datarow caption property.
Lets say that i've :
- one DataTable named dTable;
- the DataTable as 4 DataColumns;
- supose that dTable.Columns[0].ColumnName="CodTerc"
and i do:
dTable.Columns[0].Caption = "Código";
After doing this i expected that my Grid has the first column caption = "Código", but unexpectedly the caption ="CodTerC".
I know that by default datarow caption= datarow columnName, but when i change caption i expect that my grid shows the caption not the ColumnName.
If someone has an answer for this please say something.
Thanks
Carlos Lopes
|
|
|
|
|
I'm currently working on a project which has a registry representation in a treeview in which the user is able to write a path to a key (ex: HKEY_CURRENT_CONFIG\Software) and I'd like to select that registry key based on this string. Is there any way to do this?
Andreas Philipson
|
|
|
|
|
Hi, someone knows how can i do so RETURN key acts like TAB key????
I want that if the user presses return key then the application puts the focus on the next component.
Thanks
Carlos Lopes
Carlos Lopes
|
|
|
|
|
Hi Carlos
I am not to sure how long your message has been there and I am new to the "reply" function of the code-project.
If you have not resolved the matter- Read on!
I am assuming you are want to use the return/enter key to move from one control to another
A group of textboxes for example? with the "Type in data then press enter" option?
If so, about two years ago I had been racking my brain trying to figure out how to do that then came across the "SelectNextControl" method - from the code-project.
There are five parameters to the "SelectNextControl" method. These are
Ctl
The Control at which to start the search.
forward
true to move forward in the tab order; false to move backward in the tab order.
tabStopOnly
true to ignore the controls with the TabStop property set to false; otherwise, false.
nested
true to include nested (children of child controls) child controls; otherwise, false.
wrap
true to continue searching from the first control in the tab order after the last control has been reached; otherwise, false.
Return Value
true if a control was activated; otherwise, false.
If you are trying to use textboxes then generate two event handlers one for keydown and one for leave
the leave event I use for validating and entering the data into the program.
the keydown is to detect if a key is down (crazy that eh!)
I have several textboxes and the use exactly the same leave and keydown event handlers, in the case below "tbxUpper"
private void tbxUpper_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Return)
{
TextBox tbx = (TextBox)sender;
SelectNextControl(tbx, true, true, true, true);
}
}
the above event actually fires every time a key is presses in a text box but the "if statement" looks for the return key. when the return key is pressed a textbox called tbx is generated and copied from sender then the next control is selected.
If you need furthur help post a reply "and then hit Enter"!!
|
|
|
|
|
how can i change/rename an existing regestry key/value (in c/c++ code).
|
|
|
|
|
Bwhaahahahahahaaaa - this is great. The first and only question on the C# board is about straight C !!!!
Sorry, I don't mean to laugh at your question, I just find it amusing that it's the first question on the board for C#.
Some pointers for you in future.
1/ Put something meaningful in your header. C ? What does that mean ?
2/ Post to the right board. There is a lively board on C/C++, where you'll find questions answered a lot faster than in this barren place.
There is a registry class or two here at CP which I would expect would do what you want. Just search for registry and see what comes up.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|