lo que pasa es que necesito hacer un programa en visual basic porsupuesto y lo que ocupo hacer es como una lista de compras e imprimirla debe tener boton de agregar palabra a la lista , limpiar,cerrar e imprimir . lo que eh tenido problema es de como agregar una palabra de un text box a la otra y despues cuando valla a agregar otra palabra se ponga a la linea siguiente de la palabra anterior . miren aqui les dejo el codigo que llevo hasta ahorita . (NOTA: no estoy buscando que me hagan mi tarea solo busco que si me ayudan en esa parte para finalizar mi programa y ya eh hecho busqueda en la internet y no eh encontrado nada relacionado a lo que ocupo y como este es un foro maravilloso poes recurri a esta seccion del foro ) bueno espero una respuesta porfavor :vientos:
(Actualizacion sabado 30 de enero 3:46 am)
bueno ya lo resolvi por mi mismo tansolo agregando este codigo al final de textbox2.text = textbox1.text & textbox2.text (agregue esto-- &vbnewline--) y ya xD haha tan facil pero weno muchas gracias de todas formas
=========================================================
Imports System.Drawing.Printing
Public Class Form1
Private Sub Printtext(ByVal sender As Object, _
ByVal ev As PrintPageEventArgs)
ev.Graphics.DrawString(TextBox2.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, 120, 120)
ev.HasMorePages = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim PrintDoc As New PrintDocument
AddHandler PrintDoc.PrintPage, AddressOf Me.Printtext
PrintDoc.Print()
End Sub
Private Sub Done_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Done.Click
End
End Sub
Private Sub clrshplst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clrshplst.Click
TextBox2.Text = ""
End Sub
Private Sub Addto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Addto.Click
TextBox2.Text = TextBox1.Text
If TextBox2.Text = TextBox1.Text Then
TextBox1.Text = ""
End If
End Sub
End Class
=========================================================
(Actualizacion sabado 30 de enero 3:46 am)
bueno ya lo resolvi por mi mismo tansolo agregando este codigo al final de textbox2.text = textbox1.text & textbox2.text (agregue esto-- &vbnewline--) y ya xD haha tan facil pero weno muchas gracias de todas formas
=========================================================
Imports System.Drawing.Printing
Public Class Form1
Private Sub Printtext(ByVal sender As Object, _
ByVal ev As PrintPageEventArgs)
ev.Graphics.DrawString(TextBox2.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, 120, 120)
ev.HasMorePages = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim PrintDoc As New PrintDocument
AddHandler PrintDoc.PrintPage, AddressOf Me.Printtext
PrintDoc.Print()
End Sub
Private Sub Done_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Done.Click
End
End Sub
Private Sub clrshplst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clrshplst.Click
TextBox2.Text = ""
End Sub
Private Sub Addto_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Addto.Click
TextBox2.Text = TextBox1.Text
If TextBox2.Text = TextBox1.Text Then
TextBox1.Text = ""
End If
End Sub
End Class
=========================================================