rado84

experiment

Jul 9th, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Diagnostics;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11.  
  12. namespace WinForms_GoogleSearch
  13. {
  14. public partial class Form1 : Form
  15. {
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. }
  20.  
  21. private void textBox1_TextChanged(object sender, EventArgs e)
  22. {
  23.  
  24. textBox1.BackColor = Color.Yellow;
  25.  
  26. if (Environment.OSVersion.Version.Major != 6.01)
  27. { textBox1.BackColor = Color.White; }
  28.  
  29. string input = textBox1.Text;
  30. }
  31.  
  32. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  33. {
  34. comboBox1.BackColor = Color.Yellow;
  35.  
  36. if (Environment.OSVersion.Version.Major != 6.01)
  37. { comboBox1.BackColor = Color.White; }
  38.  
  39.  
  40. if (comboBox1.SelectedIndex == 0)
  41. {
  42. string input = textBox1.Text;
  43. Process.Start("www.google.bg/#newwindow=1&q=" + textBox1.Text);
  44. }
  45.  
  46. if (comboBox1.SelectedIndex == 1)
  47. {
  48. string input = textBox1.Text;
  49. Process.Start("www.google.bg/#newwindow=1&q=" + textBox1.Text +" site:"+ comboBox1.Text);
  50. }
  51.  
  52. if (comboBox1.SelectedIndex == 2)
  53. {
  54. string input = textBox1.Text;
  55. Process.Start("www.google.bg/#newwindow=1&q=" + textBox1.Text + " site:" + comboBox1.Text);
  56. }
  57.  
  58. if (comboBox1.SelectedIndex == 3)
  59. {
  60. string input = textBox1.Text;
  61. Process.Start("www.google.bg/#newwindow=1&q=" + textBox1.Text + " site:" + comboBox1.Text);
  62. }
  63.  
  64. if (comboBox1.SelectedIndex == 4)
  65. {
  66. string input = textBox1.Text;
  67. Process.Start("www.google.bg/#newwindow=1&q=" + textBox1.Text + " site:" + comboBox1.Text);
  68. }
  69. }
  70.  
  71. private void Form1_Load(object sender, EventArgs e)
  72. {
  73.  
  74. }
  75.  
  76. private void label1_Click(object sender, EventArgs e)
  77. {
  78. label1.ForeColor = Color.Yellow;
  79. }
  80.  
  81. private void label2_Click(object sender, EventArgs e)
  82. {
  83. label2.ForeColor = Color.Yellow;
  84. }
  85.  
  86. private void label3_Click(object sender, EventArgs e)
  87. {
  88. label3.ForeColor = Color.Yellow;
  89. }
  90. }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment