Jump to content
Xtreme .Net Talk

aewarnick

Avatar/Signature
  • Posts

    1052
  • Joined

  • Last visited

Everything posted by aewarnick

  1. No. Every day the program will be used by many different users without shutting the program down each time.
  2. All I have found on the internet and VS is how to print text. And that is not very helpful in itself! Here is an example which is better than the documentation VS had, but there are still problems with how to accomodate word wrap that occurs because of the margins: private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { float linesPerPage= e.MarginBounds.Height/this.RTB.Font.GetHeight(e.Graphics); string[]lines= this.RTB.Text.Split('\n'); for(int i=0; i<linesPerPage; i++) { if(i==lines.Length) break; float yPos= e.MarginBounds.Top + (i * this.RTB.Font.GetHeight(e.Graphics)); Rectangle R=new Rectangle(e.MarginBounds.Left, Convert.ToInt32(yPos), e.MarginBounds.Width, e.MarginBounds.Height); e.Graphics.DrawString(lines, this.RTB.Font, Brushes.Red, R, new StringFormat()); } The problem with that code is, like I said, the word wrap that the margins cause. When a string is too long it wraps which is great! But the rest of the document continues on the line that it was going to be on and it over-writes the wrapped text. I guess my thought is that there is a better way to print. How does MS Word do it with all the different sizes of fonts and pictures?
  3. This is what I have done so far: When the user clicks this menu item all the menu items clear and a password prompt comes up. If the password is correct the menu items are added to the box again. That works fine but the problem is that after the password is entered correctly, the user would expect the box to be shown, but I cannot figure out how to do that. I tried using PerformClick() but that did nothing at all. private void RepairMImain_Select(object sender, System.EventArgs e) { this.RepairMImain.MenuItems.Clear(); PassForm P=new PassForm(); DialogResult R= P.ShowDialog(); if(R==DialogResult.Yes) { this.RepairMImain.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.RepairMI, this.AboutRepairFilesMI, this.ViewBackupMI, this.AboutBackupMI}); } }
  4. You cannot Hide() the tab but you can Hide() the tab page itself. I did that with some of my tab pages if the password the user entered was incorrect.
  5. Do I use it as a .net library dll. If so, I could not figure out how. It does not seem to be compatable. But that does not look the case. I was really looking for a .net class I could use but I could probably figure out a way around this problem. But it would really help a lot and be a lot better to have a class.
  6. I think that cab is much better compression than zip.
  7. Yes but I did not see any where in the documentation about cab.
  8. That works perfectly, but what was the other one for?
  9. I looked on the internet but could not find any for free that zip and unzip cab files and zip files.
  10. Cursor.Position= this.ExpandedViewB.PointToScreen(this.ExpandedViewB.Location); If I did that right it is even worse than before. Any idea what is going on? I even tried it on a much less complicated form.
  11. Ok, same problem exept more weird. Cursor.Position=new Point(saveButton.Location.X, saveButton.Location.Y); That should put the cursor right on the upper left corner of the button but instead, no matter what object I put it on it is always about 20 pixels above where it needs to be and those are objects that are directly on the form, no panels. I had the same problem with the paneled objects, I figured out how to get the point of a text box relative to the panles but it is always about 20 pixels above where it needs to be.
  12. It is in a panel. That is the problem. Thank you, I did not know that.
  13. MessageBox.Show(this.RTB1.Location.X+" "+this.RTB1.Location.Y+"\n"+this.RTB1.Location); I want to use Cursor.Clip() but I cannot because the location is never right. . . That text box is not near point 0 0 but it always shows that it is, why?
  14. Ok, if that is what I have to do. . . Thanks Bucky!!
  15. I know how to write to the registry with pure C# code with no outside files but what I mean is how to import a .reg file without that confirmation coming up.
  16. The was a way to do that in batch files, how can I do it in C#? If you double click on a reg export you get the message box that says, "Are you sure you want to add ... to the registry?". And then the confirmation that it is done. How can I stop those from popping up and just accept it?
  17. I have an cab embedded recource that I want to use from my program that writes to the win\Temp folder. I can write the cab file to disk but cannot unzip it programatically and I couldn't find any classes or methods to unzip files and to zip files. Does anyone know of any good compression classes?
  18. Ok, so I got my answer, there is no better way. I just thought that it was too primitive...
  19. Yes, that is exactly what I was talking about when I said, "I know I can use that and still work around it but I think there should be a better way." Maybe that is the best way. I don't know.
  20. See, the problem with doing it that way is that if the directory does not exist then things will get messed up because I am assuming that it is a file. I know I can use that and still work around it but I think there should be a better way. I saw someone use bytes to determine if a path was a file or directory but I don't know if that is the best way either because if the file is empty then it will be 0 bytes just like the directory. But I really don't know how they used bytes to determine that, so I may be completely wrong. I would think that a folder has some attribute that no file has and that is what should be tested for. But I don't know. Please help.
  21. I am using Directory.Exists to test if a path is a dir or a file. I am sure it is one of the worst ways to do this. Does anyone know of a better way to see if a path is a file or directory?
  22. Good. Some people are just touchy and I didn't mean just you, I meant anyone.
  23. It does not work when moving to another drive like from c:\ to d:\. I should have explained that a little better. That method just moves it. It does not copy it first and that seems to be what is needed for it to work.
  24. I did some testing in windows to see what windows does to move directories to another drive and within the same drive. It copies the directory to move it to another drive but just simply moves it when it is in the same drive. My trouble is finding a method that will copy directory structures. The only ones I found are for single files. Either I have to make my own or someone here might know of one in the .net framework. My program moves directories from one place to another. That is why I need it. If there is no method in the .net framework then would the best way to do this be to copy the dir to the clip board and then paste it to the other drive?
×
×
  • Create New...