Advertisement
BaSs_HaXoR

C# Combobox to HTML Dropdown Value

Jul 27th, 2014
656
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. //How to set HTML Dropdown value in C# Combobox...
  2. //Found by: BaSs_HaXoR
  3.  
  4. //HTML Tag of site will = "monthDropDown" > http://prntscr.com/46z8tu
  5. //And the value for: 0-12, for the months.
  6.  
  7.  
  8. //FIRST! Make sure you put this in your combobox: http://prntscr.com/46z97q
  9.  
  10. //#2) Paste this somewhere in your project:
  11. this.webBrowser1.Url = new System.Uri("http://www.yourwebsitehere.com", System.UriKind.Absolute);
  12.  
  13. //#3) Then paste this inside your combobox:
  14. if (monthbox.SelectedIndex == 0)
  15. {
  16. webBrowser1.Document.GetElementById("monthDropDown").SetAttribute("value", "0");
  17. }
  18.  
  19. //#) So it will look something like this:
  20.  
  21. this.webBrowser1.Url = new System.Uri("https://account.sonyentertainmentnetwork.com/liquid/reg/account/create-account!input.action", System.UriKind.Absolute);
  22. private void monthbox_SelectedIndexChanged(object sender, EventArgs e)
  23. {
  24. if (monthbox.SelectedIndex == 0)
  25. {
  26. webBrowser1.Document.GetElementById("monthDropDown").SetAttribute("value", "0");
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement