Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3. using System.Windows.Forms.VisualStyles;
  4. using System.Drawing;
  5. using System.Drawing.Text;
  6.  
  7. //Goal, make a balloon tip that uses passed strings to display text from a console. No real reason behind this other than educating my sorry ass, cause I suck
  8.  
  9. class ToolBalloon
  10. {
  11. public static void Main()
  12. {
  13. string nText = "";
  14. Console.WriteLine("Hi there! May I have your name?");
  15. nText = Console.ReadLine(); //nText is now going to have data saved for later use, and will stay at what was entered until changed. Is there a way to call it from this change after giving it the second change?
  16. Console.WriteLine("Ah, I see, your name is " + nText);
  17. Console.WriteLine("and you seem to be new to C#. Welcome!!");
  18. Console.WriteLine("Now please enter your Mothers name");
  19. nText = Console.ReadLine();
  20. Console.WriteLine("Ah I see, your mother is named " + nText);
  21. NameDisplay(nText, null);
  22. Console.ReadLine();
  23. }
  24.  
  25. public static void NameDisplay(string fsauce, PaintEventArgs pnt)
  26. {
  27. Graphics g = Graphics.FromHwnd(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle);
  28. //Variables V <--What the fuck do I put down here for family name?? I made a string to improvise, and it seemed to work...lucky me
  29. Font eek = new Font("Times New Roman", 10);
  30. VisualStyleRenderer render = new VisualStyleRenderer(VisualStyleElement.ToolTip.Balloon.Normal);
  31. Rectangle rec1 = new Rectangle(10, 50, 50, 50);
  32.  
  33. if (VisualStyleRenderer.IsElementDefined(VisualStyleElement.ToolTip.Balloon.Normal))
  34. {
  35. render.DrawBackground(g, rec1); //NullRefrenceException occurs here for this...I am lost at where to go..It wants me to create a new object, but I already HAVE a new one.
  36. g.DrawString(fsauce, eek, Brushes.Black, new Point(10, 10));
  37. }
  38. else
  39. g.DrawString("Nothing to say to your bitch ass.", eek, Brushes.Black, new Point(10, 10));
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement