Click here to Skip to main content
15,912,329 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to obtain the index of the last entry in a collection Pin
haz1318-Aug-06 4:55
haz1318-Aug-06 4:55 
GeneralRe: How to obtain the index of the last entry in a collection Pin
Judah Gabriel Himango18-Aug-06 5:06
sponsorJudah Gabriel Himango18-Aug-06 5:06 
GeneralRe: How to obtain the index of the last entry in a collection Pin
Dustin Metzgar18-Aug-06 5:07
Dustin Metzgar18-Aug-06 5:07 
GeneralRe: How to obtain the index of the last entry in a collection Pin
Judah Gabriel Himango18-Aug-06 5:01
sponsorJudah Gabriel Himango18-Aug-06 5:01 
GeneralRe: How to obtain the index of the last entry in a collection Pin
haz1318-Aug-06 5:13
haz1318-Aug-06 5:13 
QuestionFTP Drive Space Pin
paas18-Aug-06 4:31
paas18-Aug-06 4:31 
AnswerRe: FTP Drive Space [modified] Pin
Gonzalo Brusella18-Aug-06 4:50
Gonzalo Brusella18-Aug-06 4:50 
QuestionHow do I use MSHTML to edit web <select> boxes? Pin
spark12800018-Aug-06 3:42
spark12800018-Aug-06 3:42 
Ok. So I have a function (below) that edits the contents of a web page (loaded in the WEbBrowser control). It works fine when filling in the values of text fields, checking check boxes, and clicking buttons. But I need it to also be able to select an OPTION from a SELECT box.

Actual HTML from page I'm trying to edit...
====================================
<select name="MM" dir="ltr">
<option value="">month
<option value="1" >1
<option value="2" >2
<option value="3" >3
<option value="4" >4
<option value="5" >5
<option value="6" >6
<option value="7" >7
<option value="8" >8
<option value="9" >9
<option value="10" >10
<option value="11" >11
<option value="12" >12
</select>
====================================
The C# function...
====================================
/// <summary>
/// Edit the web Form contents of WebBrowser.
/// </summary>
/// <param name="fieldName">Name of control to edit in web form.</param>
/// <param name="fValue">Value to place in fieldName control.</param>
/// <param name="click">0=textbox, 1=button, 2=checkbox 3=combobox</param>
public void fillField(string fieldName, string fValue, int type)
{
HTMLDocument myDoc = null;
try
{
myDoc = new HTMLDocumentClass();
myDoc = (HTMLDocument)WebBrowser.Document;
HTMLInputElement x = (HTMLInputElement)myDoc.all.item(fieldName, 0);
if (type == 0)
x.value = fValue;
else if (type == 1)
x.click();
else if (type == 2)
x.@checked = true;
else if (type == 3)
{
// ??
}
}
catch
{
}
finally
{
myDoc = null;
}
}
====================================

Any help would be much appreciated!

Scott Clayton
QuestionWSACAncelBlockingCall Pin
123456uio18-Aug-06 3:20
123456uio18-Aug-06 3:20 
AnswerRe: WSACAncelBlockingCall Pin
spark12800018-Aug-06 5:27
spark12800018-Aug-06 5:27 
GeneralRe: WSACAncelBlockingCall Pin
123456uio3-Sep-06 22:52
123456uio3-Sep-06 22:52 
Questionwhen .net2003 solution is migrated to .net2005, controls are not as .net2005 Pin
Ravikumar Patra18-Aug-06 3:13
professionalRavikumar Patra18-Aug-06 3:13 
AnswerRe: when .net2003 solution is migrated to .net2005, controls are not as .net2005 Pin
Stefan Troschuetz18-Aug-06 3:30
Stefan Troschuetz18-Aug-06 3:30 
GeneralRe: when .net2003 solution is migrated to .net2005, controls are not as .net2005 Pin
Ravikumar Patra18-Aug-06 3:55
professionalRavikumar Patra18-Aug-06 3:55 
QuestionDefault button on a form Pin
Le centriste18-Aug-06 2:59
Le centriste18-Aug-06 2:59 
AnswerRe: Default button on a form Pin
Christian Graus18-Aug-06 3:04
protectorChristian Graus18-Aug-06 3:04 
QuestionNested Transaction Pin
123456uio18-Aug-06 2:31
123456uio18-Aug-06 2:31 
QuestionDataGridView header click Pin
zaboboa18-Aug-06 2:24
zaboboa18-Aug-06 2:24 
AnswerRe: DataGridView header click Pin
Robert Rohde18-Aug-06 3:14
Robert Rohde18-Aug-06 3:14 
QuestionHow can i change the base address of my dll Pin
Timothy_198218-Aug-06 2:08
Timothy_198218-Aug-06 2:08 
AnswerRe: How can i change the base address of my dll Pin
Dave Kreskowiak18-Aug-06 2:25
mveDave Kreskowiak18-Aug-06 2:25 
JokeRe: How can i change the base address of my dll Pin
Guffa18-Aug-06 4:11
Guffa18-Aug-06 4:11 
GeneralRe: How can i change the base address of my dll Pin
Timothy_198219-Aug-06 4:06
Timothy_198219-Aug-06 4:06 
GeneralRe: How can i change the base address of my dll [modified] Pin
Dave Kreskowiak19-Aug-06 6:02
mveDave Kreskowiak19-Aug-06 6:02 
GeneralRe: How can i change the base address of my dll Pin
Timothy_198219-Aug-06 22:02
Timothy_198219-Aug-06 22:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.