Jump to content
Xtreme .Net Talk

mikef74

Members
  • Posts

    9
  • Joined

  • Last visited

mikef74's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I've got several RichTextBoxes, that I've given the capability of changing the font (through the fontdialog), which works fine, however, when I try to print it, I can't get the font changes to print correctly..... 'Setting the bounds to print Dim drawtext As New RectangleF(80, ypos, 700, 800) 'Setting the font from the RTB (named t2) Dim textfont As Font textfont = New Font(t2.Font.Name, t2.Font.Height, t2.Font.Style) 'Printing string e.Graphics.DrawString(t2.Text, textfont, Brushes.Black, drawtext) There has got to be an easier way. Please help. Thanks
  2. mikef74

    Zip

    I'm creating a reporting software that allows you to import pictures, and enter text into text fields. When you save the report, it saves all the text entered as one txt file, and all the pictures that were imported as jpg's. So, it is possible for any given report to have multiple files associated with it. Is there any way that VB will zip all necessary files?
  3. Let's see if I can explain this..... If it's a new report, and I import a picture, I can save it all I want, with no errors. However, once I close it and reopen that report and try to save again, the text file saves no problem, but it blows up on the "image.save(pathname)" with an error... "A generic error occurred in GDI+."
  4. I'm having problems trying to resave an image. I'm importing an image into a picturebox using the open file dialog box. I'm saving all the text that was entered into a text file using streamwriter, and saving the image using image.save(pathname). Along with saving the text into a text file, i'm also adding an extra line that contains the path name for the image. When opening the saved text file, it imports all the text into the correct fields, and using the path name it imports the image into the correct picturbox. Now, all of that works just fine. BUT, the problem is, I cannot resave an image if it already exists. Help!
  5. in addition to what I just said.... this might help... Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage e.Graphics.DrawString(Title.Text, New Font("Arial", 18, FontStyle.Bold), Brushes.Black, 350, 100) e.Graphics.DrawString(Address1.Text, New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 350, 130) If Address2.Text <> "" Then e.Graphics.DrawString(Address2.Text, New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 350, 150) e.Graphics.DrawString(Address3.Text, New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 350, 170) Else e.Graphics.DrawString(Address3.Text, New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 350, 150) End If If CoverPic.Image Is Nothing Then Else e.Graphics.DrawImage(CoverPic.Image, 75, 300) End If ' START NEW PAGE HERE ' AND CONTINUE PRINTING End Sub
  6. I've played around with that a little bit, but I'm not sure that's what I need. I'm trying to specify when I want a new page to start. I got sections of the form printing on what will be the first (cover) page, now, I want the rest of the form to print on the second, third.... pages. Any suggestions on that?
  7. I'm new to vb.net, and I'm trying to print from a form that was filled out. I've got it to work, but I'm not sure how to start a new page. This is the code I have so far. Any help would be appreciated. Thanks. Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage e.Graphics.DrawString(Title.Text, New Font("Arial", 18, FontStyle.Bold), Brushes.Black, 350, 100) e.Graphics.DrawString(Address1.Text, New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 350, 130) If Address2.Text <> "" Then e.Graphics.DrawString(Address2.Text, New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 350, 150) e.Graphics.DrawString(Address3.Text, New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 350, 170) Else e.Graphics.DrawString(Address3.Text, New Font("Arial", 12, FontStyle.Bold), Brushes.Black, 350, 150) End If If CoverPic.Image Is Nothing Then Else e.Graphics.DrawImage(CoverPic.Image, 75, 300) End If End Sub
  8. GREAT Thanks, I'll give that a try.
  9. Dynamically adding code to a button I am dynamically adding a new tabpage, and on that page adding a button (and other controls too). My question is, how do I dynamically add code the click event of that button. This is what I have so far.. Dim pagenew As New TabPage Dim b As Button b = New Button With pagenew .Text = "Page " & (Tab.TabPages.Count - 1) .Name = pagenew.Text .Controls.Add(b) End With Tab.TabPages.Add(pagenew) With b .Location = New System.Drawing.Point(281, 272) .Text = "Get Picture" .Name = "btnGet" & pagenew.Text .Size = New System.Drawing.Size(80, 24) End With pagenew.Controls.Add(b) End Sub Any help would be great! Thanks, Mike
×
×
  • Create New...