View Single Post
Eski 22/09/2007, 22:27   #2 (permalink)
MOnurCe
İptal Durumu
 
Üyelik Tarihi: 06/2007
Mesaj: 551
Varsayılan

Kaynak kodları;

Resources:

bg.png
bullet.png
pic.png


app.config

PHP Kodu:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.diagnostics>
        <sources>
            <!-- This section defines the logging configuration for My.Application.Log -->
            <source name="DefaultSource" switchName="DefaultSwitch">
                <listeners>
                    <add name="FileLog"/>
                    <!-- Uncomment the below section to write to the Application Event Log -->
                    <!--<add name="EventLog"/>-->
                </listeners>
            </source>
        </sources>
        <switches>
            <add name="DefaultSwitch" value="Information" />
        </switches>
        <sharedListeners>
            <add name="FileLog"
                 type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" 
                 initializeData="FileLogWriter"/>
            <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
            <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
        </sharedListeners>
    </system.diagnostics>
</configuration>
CodeFile1.vb

PHP Kodu:

Imports System
.Drawing.Printing

Module PrintFormStuff
    
Private Declare Auto Function BitBlt Lib "gdi32.dll" (ByVal hdcDest As IntPtrByVal nXDest As IntegerByVal nYDest As IntegerByVal nWidth As IntegerByVal nHeight As IntegerByVal hdcSrc As IntPtrByVal nXSrc As IntegerByVal nYSrc As IntegerByVal dwRop As System.Int32) As Boolean
    
Private Const SRCCOPY As Integer = &HCC0020
    
Private Declare Auto Function GetWindowDC Lib "user32" Alias "GetWindowDC" (ByVal hwnd As System.IntPtr) As System.IntPtr

    
' Return an image of the form, with or without
    ' 
decoration (borderstitle baretc).
    Public Function 
GetFormImage(ByVal frm As FormOptional ByVal with_decoration As Boolean True) As Bitmap
        
' Get this form's Graphics object.
        
Dim me_gr As Graphics frm.CreateGraphics

        
' See how big to make the result bitmap.
        Dim wid, hgt As Integer
        If with_decoration Then
            wid = frm.Width
            hgt = frm.Height
        Else
            wid = frm.ClientSize.Width
            hgt = frm.ClientSize.Height
        End If

        ' 
Make a Bitmap to hold the image.
        
Dim bm As New Bitmap(widhgtme_gr)
        
Dim bm_gr As Graphics me_gr.FromImage(bm)
        
Dim bm_hdc As IntPtr bm_gr.GetHdc

        
' Get the form's hDCWe must do this after 
        
' creating the new Bitmap, which uses me_gr.
        Dim me_hdc As IntPtr
        If with_decoration Then
            me_hdc = GetWindowDC(frm.Handle)
        Else
            me_hdc = me_gr.GetHdc
        End If

        ' 
BitBlt the form's image onto the Bitmap.
        BitBlt(bm_hdc, 0, 0, wid, hgt, _
            me_hdc, 0, 0, SRCCOPY)

        ' 
Clean up.
        
bm_gr.ReleaseHdc(bm_hdc)
        If 
Not with_decoration Then
            me_gr
.ReleaseHdc(me_hdc)
        
End If

        
' Return the result.
        Return bm
    End Function

#Region "PrintingStuff"
    ' 
Variables used to print.
    Private 
m_PrintBitmap As Bitmap
    
Private WithEvents m_PrintDocument As PrintDocument

    
' Print the form's image.
    Public 
Sub PrintForm(ByVal frm As FormOptional ByVal with_decoration As Boolean True)
        
' Copy the form's image into a bitmap.
        
m_PrintBitmap GetFormImage(frmwith_decoration)

        
' Make a PrintDocument and print.
        m_PrintDocument = New PrintDocument
        m_PrintDocument.Print()
    End Sub

    ' 
Print the form image.
    Private 
Sub m_PrintDocument_PrintPage(ByVal sender As ObjectByVal e As System.Drawing.Printing.PrintPageEventArgsHandles m_PrintDocument.PrintPage
        
' Draw the image centered.
        Dim x As Integer = e.MarginBounds.X + _
            (e.MarginBounds.Width - m_PrintBitmap.Width) \ 2
        Dim y As Integer = e.MarginBounds.Y + _
            (e.MarginBounds.Height - m_PrintBitmap.Height) \ 2
        e.Graphics.DrawImage(m_PrintBitmap, x, y)

        ' 
There's only one page.
        e.HasMorePages = False
    End Sub
#End Region ' 
PrintingStuff

#Region "SavingStuff"
    
' Save the picture.
    Public Sub SaveFormImage(ByVal frm As Form, ByVal file_name As String, Optional ByVal with_decoration As Boolean = True, Optional ByVal image_format As System.Drawing.Imaging.ImageFormat = Nothing)
        ' 
Copy the form's image into a bitmap.
        m_PrintBitmap = GetFormImage(frm, with_decoration)

        ' 
Save the bitmap.
        If 
image_format Is Nothing Then
            image_format 
System.Drawing.Imaging.ImageFormat.Bmp
        End 
If
        
m_PrintBitmap.Save(file_nameimage_format)
    
End Sub
#End Region ' SavingStuff

End Module 
Form1.vb

PHP Kodu:

Public Class Form1
    Dim secili
    
Private MouseMoving As Boolean
    
Private MouseStartPoint As Point
    Dim yazi 
As New FontDialog
    Dim renk 
As New ColorDialog
    Dim pic 
As New OpenFileDialog
    
Private Sub cho_Click(ByVal sender As System.ObjectByVal e As System.EventArgs)
    
End Sub

    
Private Sub Form1_Load(ByVal sender As System.ObjectByVal e As System.EventArgsHandles MyBase.Load
        bullet
.Visible False
        bullet
.Parent arkaplan

        baslik
.Parent arkaplan
        resim
.Parent arkaplan
        baslik2
.Parent arkaplan
        aciklama
.Parent arkaplan
        altbilgi
.Parent arkaplan

        baslik
.Left -= (arkaplan.Left)
        
baslik.Top -= (arkaplan.Top)

        
baslik2.Left -= (arkaplan.Left)
        
baslik2.Top -= (arkaplan.Top)

        
aciklama.Left -= (arkaplan.Left)
        
aciklama.Top -= (arkaplan.Top)

        
altbilgi.Left -= (arkaplan.Left)
        
altbilgi.Top -= (arkaplan.Top)

        
resim.Left -= (arkaplan.Left)
        
resim.Top -= (arkaplan.Top)

        
bullet.Left -= (arkaplan.Left)
        
bullet.Top -= (arkaplan.Top)

    
End Sub


    
Private Sub arkaplan_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles arkaplan.Click
        bullet
.Visible False
        secili 
"hic"

        
TextBox1.Visible False
        rnk
.Visible False
        font
.Visible False
        Label1
.Visible False
        uygula
.Visible False

        altbilgi
.Cursor Cursors.Default
        
baslik.Cursor Cursors.Default
        
baslik2.Cursor Cursors.Default
        
resim.Cursor Cursors.Default
        
aciklama.Cursor Cursors.Default
    
End Sub

    
Private Sub baslik_MouseDown(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles baslik.MouseDown
        secili 
"baslik"


        
Label1.Visible True
        TextBox1
.Visible True
        rnk
.Visible True
        font
.Visible True
        uygula
.Visible True
        TextBox1
.Text baslik.Text
        Button4
.Visible False


        bullet
.Left = (baslik.Left) + (arkaplan.Left)
        
bullet.Top = (baslik.Top) + (arkaplan.Top)
        
bullet.Visible True

        baslik
.Cursor Cursors.SizeAll
        baslik2
.Cursor Cursors.Default
        
aciklama.Cursor Cursors.Default
        
altbilgi.Cursor Cursors.Default
        
resim.Cursor Cursors.Default

        
MouseMoving True

        MouseStartPoint 
e.Location
    End Sub

    
Private Sub baslik_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles baslik.MouseMove

        
If MouseMoving Then

            baslik
.Left += e.MouseStartPoint.X

            baslik
.Top += e.MouseStartPoint.Y

            bullet
.Left = (baslik.Left) + (arkaplan.Left)
            
bullet.Top = (baslik.Top) + (arkaplan.Top)
            
bullet.Visible False
      
        End 
If
    
End Sub

    
Private Sub baslik_MouseUp(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles baslik.MouseUp
        MouseMoving 
False
        bullet
.Visible True
        bullet
.Left -= (arkaplan.Left)
        
bullet.Top -= (arkaplan.Top)
    
End Sub

    
Private Sub altbilgi_MouseDown(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles altbilgi.MouseDown
        secili 
"altbilgi"


        
Label1.Visible True
        TextBox1
.Visible True
        rnk
.Visible True
        font
.Visible True
        uygula
.Visible True
        TextBox1
.Text altbilgi.Text
        Button4
.Visible False

        bullet
.Left = (altbilgi.Left) + (arkaplan.Left)
        
bullet.Top = (altbilgi.Top) + (arkaplan.Top)
        
bullet.Visible True

        altbilgi
.Cursor Cursors.SizeAll
        baslik
.Cursor Cursors.Default
        
baslik2.Cursor Cursors.Default
        
resim.Cursor Cursors.Default
        
aciklama.Cursor Cursors.Default

        
MouseMoving True

        MouseStartPoint 
e.Location
    End Sub

    
Private Sub altbilgi_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles altbilgi.MouseMove
        
If MouseMoving Then

            altbilgi
.Left += e.MouseStartPoint.X

            altbilgi
.Top += e.MouseStartPoint.Y

            bullet
.Left = (altbilgi.Left) + (arkaplan.Left)
            
bullet.Top = (altbilgi.Top) + (arkaplan.Top)
            
bullet.Visible False


        End 
If
    
End Sub

    
Private Sub altbilgi_MouseUp(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles altbilgi.MouseUp
        MouseMoving 
False
        bullet
.Visible True
        bullet
.Left -= (arkaplan.Left)
        
bullet.Top -= (arkaplan.Top)
    
End Sub

    
Private Sub baslik2_MouseDown(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles baslik2.MouseDown
        secili 
"baslik2"


        
Label1.Visible True
        TextBox1
.Visible True
        rnk
.Visible True
        font
.Visible True
        uygula
.Visible True
        TextBox1
.Text baslik2.Text
        Button4
.Visible False


        bullet
.Left = (baslik2.Left) + (arkaplan.Left)
        
bullet.Top = (baslik2.Top) + (arkaplan.Top)
        
bullet.Visible True

        baslik2
.Cursor Cursors.SizeAll
        baslik
.Cursor Cursors.Default
        
aciklama.Cursor Cursors.Default
        
altbilgi.Cursor Cursors.Default
        
resim.Cursor Cursors.Default

        
MouseMoving True

        MouseStartPoint 
e.Location
    End Sub

    
Private Sub baslik2_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles baslik2.MouseMove
        
If MouseMoving Then

            baslik2
.Left += e.MouseStartPoint.X

            baslik2
.Top += e.MouseStartPoint.Y

            bullet
.Left = (baslik2.Left) + (arkaplan.Left)
            
bullet.Top = (baslik2.Top) + (arkaplan.Top)
            
bullet.Visible False
        End 
If
    
End Sub

    
Private Sub baslik2_MouseUp(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles baslik2.MouseUp
        MouseMoving 
False
        bullet
.Visible True
        bullet
.Left -= (arkaplan.Left)
        
bullet.Top -= (arkaplan.Top)
    
End Sub

    
Private Sub resim_MouseDown(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles resim.MouseDown
        secili 
"resim"

        
Button4.Visible True

        bullet
.Left = (resim.Left) + (arkaplan.Left)
        
bullet.Top = (resim.Top) + (arkaplan.Top)
        
bullet.Visible True


        Label1
.Visible False
        TextBox1
.Visible False
        rnk
.Visible False
        font
.Visible False
        uygula
.Visible False
        TextBox1
.Text ""


        
resim.Cursor Cursors.SizeAll
        baslik
.Cursor Cursors.Default
        
baslik2.Cursor Cursors.Default
        
altbilgi.Cursor Cursors.Default
        
aciklama.Cursor Cursors.Default

        
MouseMoving True
        MouseStartPoint 
e.Location
    End Sub

    
Private Sub resim_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles resim.MouseMove
        
If MouseMoving Then

            resim
.Left += e.MouseStartPoint.X

            resim
.Top += e.MouseStartPoint.Y

            bullet
.Left = (resim.Left) + (arkaplan.Left)
            
bullet.Top = (resim.Top) + (arkaplan.Top)
            
bullet.Visible False


        End 
If
    
End Sub

    
Private Sub resim_MouseUp(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles resim.MouseUp
        MouseMoving 
False
        bullet
.Visible True
        bullet
.Left -= (arkaplan.Left)
        
bullet.Top -= (arkaplan.Top)
    
End Sub

    
Private Sub aciklama_MouseDown(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles aciklama.MouseDown
        secili 
"aciklama"

        
Label1.Visible True
        TextBox1
.Visible True
        rnk
.Visible True
        font
.Visible True
        uygula
.Visible True
        TextBox1
.Text aciklama.Text
        Button4
.Visible False

        bullet
.Left = (aciklama.Left) + (arkaplan.Left)
        
bullet.Top = (aciklama.Top) + (arkaplan.Top)
        
bullet.Visible True

        aciklama
.Cursor Cursors.SizeAll
        baslik
.Cursor Cursors.Default
        
baslik2.Cursor Cursors.Default
        
altbilgi.Cursor Cursors.Default
        
resim.Cursor Cursors.Default

        
MouseMoving True
        MouseStartPoint 
e.Location
    End Sub

    
Private Sub aciklama_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles aciklama.MouseMove
        
If MouseMoving Then

            aciklama
.Left += e.MouseStartPoint.X

            aciklama
.Top += e.MouseStartPoint.Y

            bullet
.Left = (aciklama.Left) + (arkaplan.Left)
            
bullet.Top = (aciklama.Top) + (arkaplan.Top)
            
bullet.Visible False

        End 
If
    
End Sub

    
Private Sub aciklama_MouseUp(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles aciklama.MouseUp
        MouseMoving 
False
        bullet
.Visible True
        bullet
.Left -= (arkaplan.Left)
        
bullet.Top -= (arkaplan.Top)
    
End Sub


    
Private Sub font_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles font.Click
        
If secili "baslik" Then
            yazi
.ShowDialog()
            
baslik.Font yazi.Font
        
ElseIf secili "aciklama" Then
            yazi
.ShowDialog()
            
aciklama.Font yazi.Font
        
ElseIf secili "altbilgi" Then
            yazi
.ShowDialog()
            
altbilgi.Font yazi.Font
        
ElseIf secili "baslik2" Then
            yazi
.ShowDialog()
            
baslik2.Font yazi.Font
        End 
If
    
End Sub




    
Private Sub rnk_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles rnk.Click
        
If secili "baslik" Then
            renk
.ShowDialog()
            
baslik.ForeColor renk.Color
        
ElseIf secili "aciklama" Then
            renk
.ShowDialog()
            
aciklama.ForeColor renk.Color
        
ElseIf secili "altbilgi" Then
            renk
.ShowDialog()
            
altbilgi.ForeColor renk.Color
        
ElseIf secili "baslik2" Then
            renk
.ShowDialog()
            
baslik2.ForeColor renk.Color
        End 
If
    
End Sub

   
    
Private Sub uygula_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles uygula.Click
        
If secili "baslik" Then
            baslik
.Text TextBox1.Text
        
ElseIf secili "aciklama" Then
            aciklama
.Text TextBox1.Text
        
ElseIf secili "altbilgi" Then
            altbilgi
.Text TextBox1.Text
        
ElseIf secili "baslik2" Then
            baslik2
.Text TextBox1.Text
        
ElseIf secili "hic" Then
            MsgBox
("Seçili bir öğe bulunamadı")
            
TextBox1.Text ""
        
End If
    
End Sub

    
Private Sub Button1_Click_1(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button1.Click
        
If secili "hic" Then
            MsgBox
("Seçili bir öğe bulunamadı")
        ElseIf 
secili "baslik" Then
            baslik
.Visible False
            bullet
.Visible False
        
ElseIf secili "aciklama" Then
            aciklama
.Visible False
            bullet
.Visible False
        
ElseIf secili "altbilgi" Then
            altbilgi
.Visible False
            bullet
.Visible False
        
ElseIf secili "baslik2" Then
            baslik2
.Visible False
            bullet
.Visible False
        
ElseIf secili "resim" Then
            resim
.Visible False
            bullet
.Visible False
        End 
If

        
Label1.Visible False
        TextBox1
.Visible False
        rnk
.Visible False
        font
.Visible False
        uygula
.Visible False
        Button4
.Visible False
    End Sub

    
Private Sub Button2_Click(ByVal sender As System.ObjectByVal e As System.EventArgsHandles Button2.Click
        With pic
            
.Title "Bir arkaplan seçin"
            
.Multiselect False
            
.Filter "Resimler(*jpg)|*.jpg;*.gif;*.bmp;*.png;*"
            
.ShowDialog()

            If 
Not pic.FileName "" Then
                arkaplan
.Image System.Drawing.Bitmap.FromFile(pic.FileName)
            
End If
        
End With
    End Sub



    
Private Sub kydt_Click(ByVal sender As System.ObjectByVal e As