Tuesday, July 28, 2009

Dock panel in WPF and Databinding

<DockPanel >
<TextBox DockPanel.Dock="Top" Text="TOP"/>
<TextBox DockPanel.Dock="Right" Text="Right"></TextBox>
&l;tTextBox DockPanel.Dock="Bottom" Text="{Binding Path=Name}"/>
</DockPanel>


-----------------------------------
class person
{
string name = "Admin";
public string Name
{
get { return name; }
set { name = value; }
}
}
--------------------------------------
public Window1()
{
InitializeComponent();
person p = new person();
this.DataContext = p;
}
--------------------------------------

Friday, July 3, 2009

How to get Control ID's from websites using C# web browser

ButtonGetID_Click
---------------
MessageBox.Show(webBrowser1.Document.ActiveElement.Id.ToString());
----------------


Insert data to the Fileds
--------------------------

webBrowser1.Document.ActiveElement.InnerText = "smilu";
webBrowser1.Document.GetElementById("Passwd").InnerText = "password";

--------------------------

Click in HTML Buttons
-----------------------------
HtmlElement el = webBrowser1.Document.All["signIn"];
object obj = el.DomElement;
System.Reflection.MethodInfo mi = obj.GetType().GetMethod("click");
mi.Invoke(obj, new object[0]);
------------------------------