|
I'm not sure understand what you means but if you filled some fields and want to click on a link or button to send it
it would be like this:
this.webBrowser.Document.All["submit"].InvokeMember("click");
submit is the button name and click is the method
however sometimes it does not work correctly. for that you can use unmanaged HTMLDocument
<br />
<br />
object domElement = this.webBrowser.Document.All["submit"].DomElement;<br />
mshtml.IHTMLElement hElemnt = (mshtml.IHTMLElement)domElement;<br />
hElemnt.click();<br />
<br />
to read a field you can use id of it (just like name or id of a button) and use GetAttribute() method
<br />
foreach (HtmlElement he in this.webBrowser.Document.All["verb[]"].All)<br />
MessageBox.Show(he.GetAttribute("value"));<br />
to write a field you can use id of it (just like name or id of a button) and use SetAttribute() method
for text areas you must use InnerText property instead of GetAttribute() and SetAttribute() Method.
I hope the post going to be useful
good luck
|
|
|
|
|
I make dataset and after that add the column into table in database.
Although I expand dataset with it, app dont recognize added column.
It's haped to me several times.
What can I do to avoid that?
Thanks.
|
|
|
|
|
Hi
Dataset is not manage your data like recordset it is fully offline storage of data. The values in Dataset is same as last hit on your db.
|
|
|
|
|
Hi everybody
I have a class defined as MyClass<T> .
Now in code I'd like to do something like this (Option is of type T ):
if(Option is bool)
return (bool)Option ? "Yes" : "No";
But I'm not able to cast from T to bool . How can I solve this?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Try bool booleanOption = (bool)Convert.ChangeType(T, typeof(bool)) .
|
|
|
|
|
Thanks, this works
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
I'am guessing that you return some string representation for other types.
Why not use some helper methods:
string ToString(bool b) { return b ? "Yes" : "No"; }
string ToString(object o) { return o.ToString(); }
...
And call this method from your code. At runtime the correct method is called.
For your own classes, override the ToString method to get the correct string representation.
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
After reading the thread about switching on strings I can't help but present this solution:
if(Option is bool)
switch ( Option.ToString() )
{
case "True" : return "Yes" ;
case "False" : return "No" ;
}
But seriously, you probably need a better design.
|
|
|
|
|
I like switching on strings
PIEBALDconsult wrote:
But seriously, you probably need a better design.
Probably. It's a menu system for a game where you can add any options and switch between them (like: "Multisampling: On|Off"
Usually it's fine to just return the ToString() representation of this object, but in case of a "bool" menu item I don't want to return "True" and "False"
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Why on earth, CheckBoxList in windows form doesn't have datasource property.
i just want to bind my checkboxlist with dataset. How am i suppose to do that?
Thanks
|
|
|
|
|
To ratate a rectangle at an angle where angle would not be referenced from default World Cordinate but custom defined reference point.
SHK
|
|
|
|
|
is there a question ?
Get your math equations, and code them inside your Paint handler.
You will need the Math class, with Cos and Sin methods, and Pi constant.
Or you can hide behind the Graphics.RotateTransform method !
And obviously there are lots of CodeProject articles that rotate something.
|
|
|
|
|
Luc Pattyn wrote: is there a question ?
I wondered that myself. I just see a statement that even the Plain English Compiler would have a tough time parsing
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi there,
I have two classes; ClassA and ClassB.
I want that ClassA has an object of classB by which call the methods of ClassB.
like this: objectOfClassB.Methods();
ClassB is an abstract class so it cannot be instantiated.
In other words I want other classes access to ClassB only by its object in ClassA.
How can I afford to do this?
|
|
|
|
|
Majid Shahabfar wrote: I have two classes; ClassA and ClassB.
No, you don't. Nobody gives threir classes stupid names like that. In reality they have better names, that says something about what they are for. By taking away those names and creating phony names, you only make it harder to understand what it is you are trying to do.
Majid Shahabfar wrote: I want that ClassA has an object of classB
As ClassB is an abstract class, you can't create instances of it, so ClassA can not have an instance of ClassB. You have to have a class that inherts from ClassB, so that you can create an instance of that class.
Majid Shahabfar wrote: How can I afford to do this?
You can't. You would have to buy Microsoft, so that you could make them change how the language works, and obviously you can't afford to buy Microsoft.
---
single minded; short sighted; long gone;
|
|
|
|
|
Ok,
Suppose ClassB is not an abstract class.
Now show me a way by which other classes make access to ClassB members only through ClassA. (not directly instantiate an object of ClassB).
|
|
|
|
|
What is it that you are trying to accomplish really?
You can prevent creations of ClassB insteances by making the constructor non-public. If you want to restrict creation of ClassB instances to ClassA, you have to put the two classes in an assembly by themselves, so that you can make the constructor internal.
---
single minded; short sighted; long gone;
|
|
|
|
|
A bit harsh don't you think Guffa?
Freedom is the right to say that 2+2=5 if this is so everything else will follow.
|
|
|
|
|
Hi,
you could make ClassB a private inner class of ClassA, so nothing outside
ClassA would be able to instantiate or otherwise reference ClassB.
Making ClassB "abstract" is irrelevant in this; if you do you need yet another
concrete class that inherits from it.
|
|
|
|
|
Hi guys,
i have a form, which, on mouseclick, opens another form. Half of the time it's all well. But sometimes i get an InvalidOperationException with the message that this can't be done while resizing an automatically filled column.
Now, on the second form there is a gridview, which is filled at the LOAD event.
Creating Form 2:
<br />
FrmPaths f = new FrmPaths();<br />
f.Show(this);<br />
Load event:
<br />
foreach (string s in PathManagment.Directories)<br />
{<br />
dataSet1.Tables["paths"].Rows.Add(new object[] { (s) });<br />
}<br />
Could anybody please help me?
|
|
|
|
|
sounds strange .......
do you get this exception when you are debugging?
if so,
{
then there's no problem
}
else
{
i don't know
}
|
|
|
|
|
yes i got this exception when i was debugging.
i even know where it came from. I had ColumnsHeaderHeigthSizeMode on Auto by mistake. I turned it off and now the problem is gone.
I'd like to understand what the problem is, anyway. Nobody knows?
Btw. why isn't there a problem if i was debugging?
Thank you
|
|
|
|
|
i don't know whats wrong with VS, i have noticed that when im in debugging mode sometimes i get exception but when im running the project normally that when not in debugging mode, it runs fine. and mostly the exeception is null reference exception.
|
|
|
|
|
Ok thank you. That is good to know. I was really desperated.
|
|
|
|