Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- using System.Windows.Forms.VisualStyles;
- using System.Drawing;
- using System.Drawing.Text;
- //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
- class ToolBalloon
- {
- public static void Main()
- {
- string nText = "";
- Console.WriteLine("Hi there! May I have your name?");
- 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?
- Console.WriteLine("Ah, I see, your name is " + nText);
- Console.WriteLine("and you seem to be new to C#. Welcome!!");
- Console.WriteLine("Now please enter your Mothers name");
- nText = Console.ReadLine();
- Console.WriteLine("Ah I see, your mother is named " + nText);
- NameDisplay(nText, null);
- }
- public static void NameDisplay(string fsauce, PaintEventArgs pnt)
- {
- //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
- Font eek = new Font(familyName: "Times New Roman" , emSize: 10);
- VisualStyleRenderer render = new VisualStyleRenderer(VisualStyleElement.ToolTip.Balloon.Normal);
- Rectangle rec1 = new Rectangle(10, 50, 50, 50);
- if (VisualStyleRenderer.IsElementDefined(VisualStyleElement.ToolTip.Balloon.Normal))
- {
- render.DrawBackground(pnt.Graphics, 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.
- pnt.Graphics.DrawString(fsauce, eek, Brushes.Black, new Point(10, 10));
- }
- else
- pnt.Graphics.DrawString("Nothing to say to your bitch ass.", eek, Brushes.Black, new Point(10, 10));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement