30-09-12, 01:34 PM
(آخر تعديل لهذه المشاركة : 30-09-12, 03:57 PM {2} بواسطة هنودي الجميلي.)
انا عاوز اول لما تفتح s.txt Form1 show and Form Hide
عملت موضوع لاكن لم يتم الحل الموضوع القديم
كود المشروع
هذا رابط المشروع
ممكن تصحيح هذا الكود
عملت موضوع لاكن لم يتم الحل الموضوع القديم
كود المشروع
كود :
Imports System.Runtime.InteropServices
Public Class Form
Dim Selectd As Integer, Big As Long
Private Const AW_BLEND = &H1
Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Int32, ByVal dwTime As Int32, ByVal dwFlags As Int32) As Boolean
Dim winHide As Integer = &H1
Dim winBlend As Integer = &H1
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Static a As Integer
a = a + 1
If a = 25 Then
AnimateWindow(Me.Handle.ToInt32, CInt(1), winHide Or winBlend)
Timer2.Enabled = False
For Each c As Process In Process.GetProcesses
If c.MainWindowTitle = "s.txt - Notepad" Then
Me.Hide()
Form1.Show()
End If
Next
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Select Case Selectd
Case 1
Pname.Text = " Wait File Open"
Dim path = Application.StartupPath + "\s.txt"
If (System.IO.File.Exists(path)) Then
Process.Start(path)
Else
Pname.Text = "File Not Found"
End If
Timer1.Enabled = False
End Select
Selectd = Selectd + 1
End Sub
End Class
هذا رابط المشروع
ممكن تصحيح هذا الكود
كود :
If Process.Wait("s.txt") Then
Me.Hide()
Form1.Show()
End If