Jump to content

Recommended Posts

Posted

Currently I'm writing 1 program manager for my company but i don't know how to print out 1 A4 page? So...

Can I print out from 1 GUI to A4 paper? How after print all button on GUI will hide? And I can use what code to print to A4 paper? Or with other size?

Below is my GUI

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test Print", 507, 320, 192, 124)
$Group1 = GUICtrlCreateGroup("Bill", 8, 56, 489, 217)
$Label1 = GUICtrlCreateLabel("Customer:", 16, 80, 51, 17)
$Label2 = GUICtrlCreateLabel("Product:", 16, 112, 44, 17)
$Label3 = GUICtrlCreateLabel("Price:", 16, 144, 31, 17)
$Label4 = GUICtrlCreateLabel("Amount:", 16, 176, 43, 17)
$Label5 = GUICtrlCreateLabel("Total:", 16, 208, 31, 17)
$Button2 = GUICtrlCreateButton("Add Customer", 16, 240, 91, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Edit Info", 136, 240, 83, 25, $WS_GROUP)
$Button4 = GUICtrlCreateButton("Delete", 400, 240, 83, 25, $WS_GROUP)
$Label7 = GUICtrlCreateLabel("..........................................................................................................................................", 72, 80, 418, 17)
$Label8 = GUICtrlCreateLabel("..........................................................................................................................................", 72, 112, 418, 17)
$Label9 = GUICtrlCreateLabel("..........................................................................................................................................", 72, 144, 418, 17)
$Label10 = GUICtrlCreateLabel("..........................................................................................................................................", 72, 176, 418, 17)
$Label11 = GUICtrlCreateLabel("..........................................................................................................................................", 72, 208, 418, 17)
$Button5 = GUICtrlCreateButton("Has paid", 264, 240, 99, 25, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Print", 424, 288, 75, 25, $WS_GROUP)
$Label6 = GUICtrlCreateLabel("XY Company", 176, 8, 191, 40)
GUICtrlSetFont(-1, 24, 800, 0, "Times New Roman")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Thanks everyone interested in this topic :)

Thanks you very much :)

Posted (edited)

@Zedna: Thanks you :)

I had ever read that topic, but when use seen error ;)

Below image is error

Posted Image

And add 1 question, How make I can see the format before printing?

Edited by anhchangtk

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...