Jump to content
Xtreme .Net Talk

aewarnick

Avatar/Signature
  • Posts

    1052
  • Joined

  • Last visited

Everything posted by aewarnick

  1. Use the TextChanged event and loop through the list for the closest match. Then set that as the text in the box. To create the highlighted effect the text property should have a method called SetSelected...
  2. Yes, draw it directly to the Form in an overridden OnPaint();
  3. You forgot to hook up the Click event in InitializeComponent(). this.Click += new MouseEventHandler(this.txt_Click);
  4. Show sets the Visible attribute to true, and Hide, false.
  5. When a form is closed it is also disposed, unless it is a dialog. Then you must call Dispose() manually.
  6. It sure is available. Although it is not directly known to .net. You must write a "template" for the function you want to use. Look it up on the net, you will find plenty of info on api and .net.
  7. You mean taking a screenshot? You need to use the windows api to do that, not any .net stuff.
  8. Here you are multiplying a double by an int public static int CalculateTaxAmount(double convertprice,int nondecimaltax) { double nondecimalanswer; nondecimalanswer=convertprice*nondecimaltax; return nondecimalanswer; } You need to either convert the nondecimalanswer to an int or return a double. You did not give me any error info, so I could not decide exacly what your problem was. But this is definately one.
  9. It works for me. What control are you using, the monthCalendar?
  10. No diagnosis can be made without more info. Like code.
  11. I'm stumped...
  12. Do you get that error only when Notepad is open? If so, close the file and try again. Otherwise reboot and try again.
  13. Why would you be using notepad to open the file if you can just use your program?
  14. You shouldn't have a problem. This works //my own messagebox and own Read File method: a.MB.ShowDialog(a.Files.ReadText("D:\\test.txt")); //the Read File method in class a, class Files (my own classes): /// <summary> /// Reads a text file from disk. /// </summary> public static string ReadText(string path) { string s=""; Stream F=new FileStream(path, FileMode.Open, FileAccess.Read); if(F.Length> long.MaxValue) { int onebyte= 0; int bytesR= 0; byte[]c= new Byte[ulong.MaxValue]; while(true) { onebyte= F.ReadByte(); if(onebyte==-1) {F.Close(); s= Encoding.ASCII.GetString(c, 0, c.Length); return s;} c[bytesR]= (byte)onebyte; ++bytesR; } } if(F.Length> int.MaxValue) { int onebyte= 0; int bytesR= 0; byte[]c= new Byte[F.Length]; while(true) { onebyte= F.ReadByte(); if(onebyte==-1) {F.Close(); s= Encoding.ASCII.GetString(c, 0, c.Length); return s;} c[bytesR]= (byte)onebyte; ++bytesR; } } byte[]b=new Byte[F.Length]; F.Read(b, 0, Convert.ToInt32(F.Length)); s= Encoding.ASCII.GetString(b); F.Close(); return s; }
  15. Take any cur file, add it to your project as an EmbeddedResource and then... Cursor prevCur=null; prevCur=new Cursor(this.GetType(), "PrevCursor7.cur"); this.pictureBox1.Cursor= prevCur;
  16. You can do a trillion things and more with one button click. Just put all the code in the Clicked event of the button.
  17. Good luck! You're probably better off learning on your own by reading up-to-date books.
  18. //up right underneath the Form class, making it a global variable accessable all throughout the class. ArrayList selItems=new ArrayList(); //down in your code somewhere foreach(string x in this.selItems) { if(x==item.Value) this.selItems.Add(x); } If that is not good enouph, post what you are doing and I'll try to put that together for you.
  19. foreach (ArrayList selItems in this.selItems.LastIndexOf(selItems)) I think your problem is right there. You iterate through the type of items in the Arraylist. You are trying to iterate through any items in the ArrayList that are of type ArrayList. For example, if the items stored in the ArrayList of strings then you would write foreach(string x in this.selItems) if you don't know the type just use object instead.
  20. Try recompiling the program in release mode.
  21. You asked: How do you make the first numbers go away and be stored in ram so you can enter the second set of numbers then when you hit enter that set of numbers go away and the total is displayed. --------------- You really should get a book or something to learn about this basic stuff. Here's a start. Global variables are variables that are outside of local functions, methods, or subs. They are declared once and only once and therefore hold their values until the object they are declared in is destroyed (In mose cases, the Form destroyed). They can be used all throughout the Form. In your case you will probably want to use either float or double variables to store decimal values. That is, if you are using C# not VB .net. In VB .net it is the same principal just different names. To access global variables in C# you can use the this accessor. public class c : Form { double number1= 0; public c() { this.number1= 67.5543256; this.GetNumber(); //messagebox displayed here would be 67.5543256 } public GetNumber() { MessageBox.Show(this.number1); } } That is not a very good teaching on global variables but at least you can now "experiment".
  22. Global variables store their values until the object (the Form) is destroyed. Local variables reset when the block is exited.
  23. Use global variables. Varialble declared inside the Form class and not in a local block. using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; namespace AW { public class Form1 : a.Forms.aForm { //-------------These are global variables-------------- a.Forms.ImageLB FilePicker=new a.Forms.ImageLB(); Color autoTranspColor= Color.Empty; a.graphics.DrawingSurface surface;
  24. My suggestion is, forget VB .net and learn C# instead. That way if you want to move on to C++ it will be easier to do.
  25. Declare it outside of the local block and inside the Form class block - a global variable.
×
×
  • Create New...