|
Once you get the document object you can get the button element using the all collection or walking the DOM until you get the button object. Then you just use the IHTMLElement click method to simulate the click. Make sure you use the IE interop objects which come with the framework rather then generating your own. They have an easier to use object model.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
How do you walk the DOM? I cant figgure out how to use the ALL collection because it needs a name and what i am trying to click on is a link not a button.(foud this out after ripping appart the HTML)the link activates some javascript.
|
|
|
|
|
Even easier then, you can use the anchors collection of the document object to find the link you need, then just call the click method on the object.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Awsome. thanks. now my only problem is how to force an INPUT Type=file to a specific value. according to the help, the value is read only from the programatic end.
|
|
|
|
|
I have also found that, after making an app that automates a process of acessing a web site to be able to download files from the site, as well as delete them, u can manaully POST the data to the server and get the right response, this can be used to be able to upload and download files, its a bit of a mess sometimes (because of the POST data u may need) but u can use apps like Fiddler http://www.fiddlertool.com/fiddler/[^]
its a good app for viewing requests and response across the net.
hope that helps a bit
|
|
|
|
|
I have a Panel Control containing a PictureBox in it
If I set a picture for PictureBox and the size of the PictureBox is large enough to show the ScrollBars of the Panel control
Infact I am trying to add the scrolling functionality to My PictureBox and scroll it programmatically
How do I programmatically set the values of the ScrollBars of the Panel control such that the center of the PictureBox is in the Center of the Panel control.
I have used the AutoScrollPosition property of the Panel control, but, can't find the solution to my problem (how to scroll to the center)
I hope you understand my problem
Hoping for a quick reply
Thank You
|
|
|
|
|
panel.AutoScrollPosition = new Point((pictureBox.Width - panel.ClientRectangle.Width) / 2, (pictureBox.Height - panel.ClientRectangle.Height) / 2);
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
Hello All,
I want to add rows to dataGrid dynamically without using the datasource property. My problem is that if I bind a source to dataGrid using its datasource property, and when new datacomes in my source, it doesn't reflect in the dataGrid. I have to rebind the datagrid using
dataGrid1.datasource = null;
dataGrid1.datasource = Source;
i don't want to do this...as it refreshes the grid and clears previously selected rows and cells in grid.
What I want to do is something like we do in listbox..
listbox1.items.add(".....");
Any suggesstions or help?..
Thanks
Ritesh Tijoriwala.
|
|
|
|
|
Hi,
How can I set a DateTime to return a null?
for example
DateTime dtDateTime = null; it doesn't work.
Thanks
Tony
|
|
|
|
|
|
Return year 0 date 1/1 time 00:00:00 or something, and specific milliseconds to. And then check it at return. Otherwise you could throw an exception that does that. And catch it higher.
Niklas Ulvinge aka IDK
|
|
|
|
|
Use DateTime.MinValue.
public static readonly DateTime MinValue;<br />
<br />
Remarks<br />
The value of this constant is equivalent to 00:00:00.0000000, January 1, 0001.
---
b { font-weight: normal; }
|
|
|
|
|
I got Microsoft Visual Studio 2005 Beta 2 and I developed a program. I asced some people to run it and they said it didn't.
How do I make it work on other computers?
Niklas Ulvinge aka IDK
|
|
|
|
|
They must have the same version of the .NET Framework installed as the one you used to develop the application. Since you used VS 2005, they need to have the .NET Framework 2.0 Beta installed.
But, this is not as simple as it may seem. You can't just download the .NET Framework 2.0 redistributable package and install it anywhere. It's still a Beta and not authorized for release.
See this[^] page for more information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In all practicality, though, I can't imagine anyone will be upset if he makes his users install the 2.0 beta, assuming this is "see what I did" kind of thing as he made it sound.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Hello,
I have a dataset, and I want to go through the dataset, and select particular rows. Is there a way of defining a DataRow array, to which I can attach the picked rows.
I tried to use:
DataRow[] myRows = null;
and then putting the selected rows there, but to no avail.
Any ideas?
Thank you.
|
|
|
|
|
|
Show us the code you used.
Jon Sagara
As you may presently yourself be fully made aware of, my grammar sucks.
Sagara.org | Blog | My Articles
J.O.N.S.A.G.A.R.A.: Journeying Operational Neohuman Skilled in Assassination, Galactic Analysis and Rational Astrophysics
|
|
|
|
|
I created a smart document that creates a list of students in word. This information comes from a custom API exposed by a .NET application I made.
All seems ok, except: I can't get the security right for the document, it keeps telling me my security settings are wrong and I don't have the full trust policy on my assembly.
I checked everything:
- I have a zone Office_Projects
- I have a specific zone for my <docname>_bin with execution rights
- I have a specific zone for my <docname>.dll inside the bin folder that has fulltrust.
Still it doesn't work. Anyone have had this problem before and can tell me more about this issue?
WM.<br>
<b>What about weapons of mass-construction?</b>
-- modified at 9:48 Friday 16th September, 2005
|
|
|
|
|
Hi
I want to create a page where someone can view if someone has been seen within a week or not with 2 buttons on the page, 1 to click which will display records of people who were which will show results in a datagrid and another button to show which was not and to show in a datagrid.
The way the system works now is someone fills out an initial form which populates the data in a table below and the date of submission is recorded:
Initial Referral table
RefID int 4 0
Base varchar 150 0
CustNumber int 4
ReasonForAppointment varchar 50
TimeSpent varchar 50
Contact varchar 50 0
CustomerType varchar 50
Comments varchar 2000
DateSubmitted datetime 8
Then someone else will need to follow up the referral from another form and the following is added and date of submission recorded:
Follow up table
FollowUpID int 4
RefID int 4 0
AdditionalInfo varchar 2000
Point1 bit 1
Point2 varchar 2000
DateToBeCompleted datetime 8
ClientSeen bit 1
DateSubmitted datetime 8
I have the form pages all done, it is just this page i am having a problem with so it can calculate if the dates are longer or shorter than the 2 dates from the two tables and fill the datagrid with the right results.
Any hints or points in the right direction will be appreciated.
Cheers
|
|
|
|
|
How do I convert an array of objects to an array of bytes?
I don't know how to do it the old way like in C, get the address of and the size of the object and then save it to a file...
Niklas Ulvinge aka IDK
|
|
|
|
|
If you're just wanting to serialize the array, the following should work (generically, for any binary serializable type):
using System;
using System.Runtime.Serialization.Formatters.Binary;
namespace SomeStuff
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
string[] foo = new string[3]{"a", "b", "c"};
byte[] bytes = BinaryConverter.SerializeThis(foo);
string[] newFoo = (string[])BinaryConverter.DeserializeThat(bytes);
foreach(string s in newFoo)
Console.WriteLine(s);
Console.ReadLine();
}
}
class BinaryConverter
{
private BinaryConverter(){}
public static object DeserializeThat(byte[] bytes)
{
object graph = null;
if (bytes != null && bytes.Length > 0)
{
BinaryFormatter formatter = new BinaryFormatter();
MemoryStream stream = new MemoryStream(bytes);
graph = formatter.Deserialize(stream);
stream.Close();
}
return graph;
}
public static byte[] SerializeThis(object graph)
{
byte[] bytes = null;
if (graph != null)
{
BinaryFormatter formatter = new BinaryFormatter();
MemoryStream stream = new MemoryStream();
formatter.Serialize(stream, graph);
bytes = stream.GetBuffer();
stream.Close();
}
return bytes;
}
}
}
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
I don't know what to serilize an array is but you forget to include
using System.IO;
And I got some errors wich I fixed with making the class I used [Serializable]
I really just want to save the data to a file...
And after a little fixing it worked. Thanks
Niklas Ulvinge aka IDK
|
|
|
|
|
I got an error. If I saved an array of 8 objects it loads 9 and the last one is null.
That's bad.
Niklas Ulvinge aka IDK
|
|
|
|
|
That's not a lot to go on. I have no idea what your source code looks like. If you'd like to include it (code that builds the array, serializes it and deserializes it, along with the type you're trying to serialize in the array), I can have a look.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|