In winfrom program if you want to get a folder path name "Process" under exectue application folder.
you can use this function => Path.Combine(Application.StartupPath, "Process")
Please DON'T put "\" Like this => Path.Combine(Application.StartupPath, "\Process")
You will only get string "\Process"....
Read more.
分享使用微軟開發工具及工作上會遇到的疑難雜症
2013-08-12
2010-08-31
[+/-] : Visual Studio 2010 英文版 .NET 3.5 SP1 Crystal Report 2008 FP31 Winform 內嵌於 Setup 專案內的解決方案
1.安裝VS2010英文版!(中文版不知行不行,請測過的朋友告知,謝謝!)
2.安裝cr4vs2010.exe 如果無法下載!請網路上自行尋找,下載網址如下:
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/20322
目前有二個版本:
Beta 1 MD5: 48B63F922440CC98C207720D48FE0E79
Beta 2 MD5: 7E6D73E19C4ECC252B61C7529C44AD39
3.將Crystal Report 2008更新到最新的Service Pack
筆者是安裝Crystal Report 2008 SP0然後一路安裝升級包
SP1, SP2, SP3, FP31,目前最新的Pack,安裝網址如下:
https://websmp130.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/spn/bobj_download/main.htm
下拉選單:
Software Product 選 Crystal Reports
Product Version (optional) 選 Crystal Reports 2008
Software Type (optional) 選 Utility
然後按下Search按鈕
裝完最新的service pack fp31 之後別忘了還要下載Crystal Reports 2008 Fix Pack 3.1 - Merge Modules
下載完成會得到cr2008sp3_mm_fp31.zip
請解壓後,把CRRuntime_12_3.msm,如果需要繁簡體,請一起複制起來,CRRuntime_12_3_zh_CN.msm,CRRuntime_12_3_zh_TW.msm
放到C:\Program Files (x86)\Common Files\Merge Modules
32位元作業系統請把(x86)拿掉
4.請參考VS2008 SP1 如何設定讓 .NET 3.5 SP1 內嵌於 Setup 專案內
5.將Microsoft Visual C++ 2005 Redistributable Package (x86)也內嵌於專案內
http://www.xun6a.us/file/8bf2543d8/vcredist_x86_2005.zip.html
於此下載,解壓後會得到一個vcredist_x86_2005目錄,將此目錄複制貼到以下路徑
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\
注意:如果客戶端不想用內嵌的方式,則必需自行安裝.Net Framework 3.5 SP1和
Microsoft Visual C++ 2005 Redistributable Package (x86)
------------------------------------------------------------------------------------------------------------
開始測試:
1.先開一個新的空的專案選要存的地方(桌面),執行環境別忘了要選.Net Framework 3.5
2.在空的專案內按右鍵,加入Windows Form專案選.Net Framework 3.5
加一個新的WinForm在左邊Toolbar選到Crystal Report Viewer拉到視窗內,按下Show All Files按鈕
就會看到References裡面多了6個Crystal Report的dll

請把這6個Crystal開頭的References記下來
然後選起來之後選右鍵,Remove掉
再依序到以下目錄一個一個加回來
C:\Program Files (x86)\Business Objects\Common\4.0\managed
C:\Program Files (x86)\Business Objects\Common\4.0\managed\dotnet2
3.在空的專案內按右鍵,加入Setup專案選.Net Framework 3.5
在Setup專案上按右鍵選Add=>Merge Module...選CRRuntime_12_3.msm,如需繁簡體CRRuntime_12_3_zh_CN.msm,CRRuntime_12_3_zh_TW.msm也一併加入
4.選到CRRuntime_12_3.msm右鍵Properties看到MergeModuleProperties,在Keycode輸入
5.在空的專案內按右鍵Properties選到Prerequisites...按鈕
把.net4.0 勾勾取消
.NET Framework 3.5 SP1打勾
Microsoft Visual C++ 2005打勾
Installwindows 3.1打勾
選Download prerequisites from the same location as my application

如果是自己安裝不需內嵌的客戶端,那就都
把.net4.0 勾勾取消把.NET Framework 3.5 SP1打勾
其他留預設就行
Download prerequisites from the component vendor's web site
6.在Setip專案內Detected Dependencies目錄展開選到Microsoft .NET Framework點二下
把Version從.NET 4.0改成.NET Framework 3.5

7.搞定囉,可以開始編譯了
最後會得到

執行setup.exe就會檢查.NET 3.5 SP1和Microsoft Visual C++ 2005
如果沒有就會自動裝好,搞定收工!
後記,編譯時會得到15個Warnings,但是不影響執行結果
如果有解決Warnings的朋友請幫忙告知,如何解決,多謝...
Read more.
2.安裝cr4vs2010.exe 如果無法下載!請網路上自行尋找,下載網址如下:
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/20322
目前有二個版本:
Beta 1 MD5: 48B63F922440CC98C207720D48FE0E79
Beta 2 MD5: 7E6D73E19C4ECC252B61C7529C44AD39
3.將Crystal Report 2008更新到最新的Service Pack
筆者是安裝Crystal Report 2008 SP0然後一路安裝升級包
SP1, SP2, SP3, FP31,目前最新的Pack,安裝網址如下:
https://websmp130.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/spn/bobj_download/main.htm
下拉選單:
Software Product 選 Crystal Reports
Product Version (optional) 選 Crystal Reports 2008
Software Type (optional) 選 Utility
然後按下Search按鈕
裝完最新的service pack fp31 之後別忘了還要下載Crystal Reports 2008 Fix Pack 3.1 - Merge Modules
下載完成會得到cr2008sp3_mm_fp31.zip
請解壓後,把CRRuntime_12_3.msm,如果需要繁簡體,請一起複制起來,CRRuntime_12_3_zh_CN.msm,CRRuntime_12_3_zh_TW.msm
放到C:\Program Files (x86)\Common Files\Merge Modules
32位元作業系統請把(x86)拿掉
4.請參考VS2008 SP1 如何設定讓 .NET 3.5 SP1 內嵌於 Setup 專案內
5.將Microsoft Visual C++ 2005 Redistributable Package (x86)也內嵌於專案內
http://www.xun6a.us/file/8bf2543d8/vcredist_x86_2005.zip.html
於此下載,解壓後會得到一個vcredist_x86_2005目錄,將此目錄複制貼到以下路徑
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\
注意:如果客戶端不想用內嵌的方式,則必需自行安裝.Net Framework 3.5 SP1和
Microsoft Visual C++ 2005 Redistributable Package (x86)
------------------------------------------------------------------------------------------------------------
開始測試:
1.先開一個新的空的專案選要存的地方(桌面),執行環境別忘了要選.Net Framework 3.5
2.在空的專案內按右鍵,加入Windows Form專案選.Net Framework 3.5
加一個新的WinForm在左邊Toolbar選到Crystal Report Viewer拉到視窗內,按下Show All Files按鈕
就會看到References裡面多了6個Crystal Report的dll

請把這6個Crystal開頭的References記下來
然後選起來之後選右鍵,Remove掉
再依序到以下目錄一個一個加回來
C:\Program Files (x86)\Business Objects\Common\4.0\managed
C:\Program Files (x86)\Business Objects\Common\4.0\managed\dotnet2
3.在空的專案內按右鍵,加入Setup專案選.Net Framework 3.5
在Setup專案上按右鍵選Add=>Merge Module...選CRRuntime_12_3.msm,如需繁簡體CRRuntime_12_3_zh_CN.msm,CRRuntime_12_3_zh_TW.msm也一併加入
4.選到CRRuntime_12_3.msm右鍵Properties看到MergeModuleProperties,在Keycode輸入
5.在空的專案內按右鍵Properties選到Prerequisites...按鈕
把.net4.0 勾勾取消
.NET Framework 3.5 SP1打勾
Microsoft Visual C++ 2005打勾
Installwindows 3.1打勾
選Download prerequisites from the same location as my application

如果是自己安裝不需內嵌的客戶端,那就都
把.net4.0 勾勾取消把.NET Framework 3.5 SP1打勾
其他留預設就行
Download prerequisites from the component vendor's web site
6.在Setip專案內Detected Dependencies目錄展開選到Microsoft .NET Framework點二下
把Version從.NET 4.0改成.NET Framework 3.5

7.搞定囉,可以開始編譯了
最後會得到

執行setup.exe就會檢查.NET 3.5 SP1和Microsoft Visual C++ 2005
如果沒有就會自動裝好,搞定收工!
後記,編譯時會得到15個Warnings,但是不影響執行結果
如果有解決Warnings的朋友請幫忙告知,如何解決,多謝...
Read more.







2010-08-10
[+/-] : Word 套版 With Office Word 2007 問題
網路上找的大部份都是這樣的範例,當成功執行之後[Name]會被換成Boss
一切都是這樣的美好,因為我們全公司都使用Office 2003
可是好景不常,噹噹噹~踢到了一個鐵板
---------------------------
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Word.Find.set_Text(String prop)
---------------------------
網路上眾說紛雲,
1.有人說是記憶體壞掉
2.也有說是因為Office 2003和Office 2007同時安裝的關係
嗯~發生問題的User真的是使用Office 2007
長話短說,為了這個問題在茫茫網海中花了二天半的時間
最後當然是找到了解決方式
原來只要改一個字
把Word.WdFindWrap.wdFindContinue改成Word.WdFindWrap.wdFindAsk
問題解決!
如果套板的文字只要換一次可以把wdReplaceAll改成wdReplaceOne
這樣可以節省一些時間喔!
Case close....
Read more.
一切都是這樣的美好,因為我們全公司都使用Office 2003
Dim word As New Microsoft.Office.Interop.Word.Application
Dim doc As Microsoft.Office.Interop.Word.Document
Try
doc = word.Documents.Open("C:\1.doc")
doc.Activate()
Dim myStoryRange As Microsoft.Office.Interop.Word.Range
For Each myStoryRange In doc.StoryRanges
With myStoryRange.Find
.Text = "[Name]"
.Replacement.Text = "Boss"
.Wrap = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue
.Execute(Replace:=Microsoft.Office.Interop.Word.WdReplace.wdReplaceAll)
End With
Next myStoryRange
word.Visible = True
Catch ex As COMException
MessageBox.Show("Error accessing Word document.")
Finally
doc = Nothing
word = Nothing
End Try
可是好景不常,噹噹噹~踢到了一個鐵板
---------------------------
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Word.Find.set_Text(String prop)
---------------------------
網路上眾說紛雲,
1.有人說是記憶體壞掉
2.也有說是因為Office 2003和Office 2007同時安裝的關係
嗯~發生問題的User真的是使用Office 2007
長話短說,為了這個問題在茫茫網海中花了二天半的時間
最後當然是找到了解決方式
原來只要改一個字
把Word.WdFindWrap.wdFindContinue改成Word.WdFindWrap.wdFindAsk
問題解決!
如果套板的文字只要換一次可以把wdReplaceAll改成wdReplaceOne
這樣可以節省一些時間喔!
Case close....
Read more.







2010-05-11
[+/-] : Winfrom 子視窗傳值給父視窗
直接看Code囉
Read more.
...
先在Form1建立一個Untyped dataset並取名為DS1及Textbox取名為TextBox1
Public Class Form1
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim sForm2 As New Form2()
sForm2.ShowDialog(Me)
DataGridView1.DataSource = DS1.Tables(0)
End Sub
End Class
Public Class Form2
Dim db As New VivaDataClassesDataContext()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm1 As Form1 = DirectCast(Me.Owner, Form1)
DirectCast(frm1.Controls("textBox1"), TextBox).Text = TextBox1.Text
Dim query = From p In db.Product_Daily_Report_Comment _
Select p
frm1.DS1.Tables(0).Load(New DataTableReader(query.ToDataTable()))
Me.Close()
End Sub
End Class
Read more.







2009-11-30
[+/-] : ToString Format 使用時的注意事項
承上一篇文章
剛才遇到一個問題~特此來紀錄一下
因為DB的TABLE不是筆者開的!所以一直沒注意到從DB叫出來的數值
使用 .ToString("0000") 會有問題
在DB內原來開的欄位是numeric(18, 0)
欄位內的數值為911062
使用
MsgBox(Mid(DS_View.Tables(0).Rows(0).Item("LastNo").ToString("0000000"), 1, 4))
各位猜的到叫出來會是什麼答案嗎?
答案是9
酷吧!完成出乎筆者的意料之外
因為筆者想得到的答案很簡單
就是先把911062轉成0911062然後從第一位數取四個
就是0911
可是只有取到一個9
天吶~
解決方法!把該欄位先轉成Integer就好了
MsgBox(Mid(CType(DS_View.Tables(0).Rows(0).Item("LastNo"), Integer).ToString("0000000"), 1, 4))
使用前請注意喔
不然遇到問題再來解決也是很花時間的...
Read more.
剛才遇到一個問題~特此來紀錄一下
因為DB的TABLE不是筆者開的!所以一直沒注意到從DB叫出來的數值
使用 .ToString("0000") 會有問題
在DB內原來開的欄位是numeric(18, 0)
欄位內的數值為911062
使用
MsgBox(Mid(DS_View.Tables(0).Rows(0).Item("LastNo").ToString("0000000"), 1, 4))
各位猜的到叫出來會是什麼答案嗎?
答案是9
酷吧!完成出乎筆者的意料之外
因為筆者想得到的答案很簡單
就是先把911062轉成0911062然後從第一位數取四個
就是0911
可是只有取到一個9
天吶~
解決方法!把該欄位先轉成Integer就好了
MsgBox(Mid(CType(DS_View.Tables(0).Rows(0).Item("LastNo"), Integer).ToString("0000000"), 1, 4))
使用前請注意喔
不然遇到問題再來解決也是很花時間的...
Read more.







[+/-] : ToString Format 齊頭用法
今早改寫公司的ERP時!看到了為了要數字轉文字而且While迴圈的寫法
初始值是數字1 可是想要産出0001的文字格式
看到了吧!舊式的這樣不錯吧!
其實在我以前也不這樣寫 我會這樣寫
這樣的解法是把數字1轉成文字之後 再加上0000四個零
最後再取最後右邊四位!就會得到格式0001
作法全是對的 但是有新的做法囉
請看
搞定
是不是很爽^_^
非常直覺非常好用!必學喔...
Read more.
初始值是數字1 可是想要産出0001的文字格式
Dim xLastNO As Integer = 1
Dim xLastNO_Str As String
While xLastNO_Str.Length < 4
xLastNO_Str= "0" + xLastNO_Str
End While
看到了吧!舊式的這樣不錯吧!
其實在我以前也不這樣寫 我會這樣寫
Dim xLastNO As Integer = 1
Dim xLastNO_Str As String
xLastNO_Str = Right("0000" + xLastNO.ToString() , 4)
這樣的解法是把數字1轉成文字之後 再加上0000四個零
最後再取最後右邊四位!就會得到格式0001
作法全是對的 但是有新的做法囉
請看
Dim xLastNO As Integer = 1
Dim xLastNO_Str As String = xLastNO.ToString("0000")
搞定
是不是很爽^_^
非常直覺非常好用!必學喔...
Read more.







2009-10-14
[+/-] : Infragistics Win UltraWinGrid 水平捲軸 移過太慢造成畫面錯誤

如果 發生以上的畫面解決方法還蠻簡單的
請看到最後一個row是不是只有出現三分之一
剩下的被水平捲軸擋到了
只要把此WinGrid的高度加高一點點就行讓最後一行的Row
不會被擋到就可!
搞定~收工...
Read more.







2009-09-24
[+/-] : WinForm內開啟一個新灠器的視窗
公司內部在用的是Winform的介面,每次有功能更新,都需要請使用者手動更新
所以每次功能更新時,我會發Email請相關人員更新,並把更新的功能和使用方式寫上
但是寄出的Email很少有人看,大家都是看到有更新就去按Update的按鈕,但是更新了什麼卻不知
所以想把更新的歷史記錄寫成Web的方式,作成一個列表,請使用者有空再去看,
所以就在WinForm的介面加一個LinkLabel,並在程式code的地方加上
就搞定囉...
Read more.
所以每次功能更新時,我會發Email請相關人員更新,並把更新的功能和使用方式寫上
但是寄出的Email很少有人看,大家都是看到有更新就去按Update的按鈕,但是更新了什麼卻不知
所以想把更新的歷史記錄寫成Web的方式,作成一個列表,請使用者有空再去看,
所以就在WinForm的介面加一個LinkLabel,並在程式code的地方加上
Private Sub LinkLabel1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkLabel1.Click
System.Diagnostics.Process.Start("http://yourURL")
End Sub
就搞定囉...
Read more.







2009-09-16
[+/-] : Decimal.Round 產出的錯誤信息
Decimal.Round(CType(txt.ToString(), Decimal), 2).ToString
之前在VS2003 .NET 1.1 Run的好好的程式,因為昇級到了VS2005 .NET 2.0 Sp2的環境之後
產生的錯誤訊息,因為VS2005之後就可以使用Math.Round這個Function所以大概只有昇級完會碰到這個問題吧,而且在編譯時不會有任何的錯誤,是在Run Time才會發現,所以才頭痛啊,言歸正傳
Decimal.Round只接受傳入的值為Decimal所以轉型一下就ok囉
Dim txt As Decimal = Ctype(txt.Tostring(), Decimal)
Decimal.Round(txt, 2).ToString()
如需叫用 Just-In-Time (JIT) 偵錯的詳細資料,
請參閱本訊息結尾處 (而非這個對話方塊) 的資訊。
************** 例外狀況文字 **********
System.Reflection.AmbiguousMatchException: Overload resolution failed because no Public 'Round' can be called without a narrowing conversion:
'Public Shared Function Round(d As Decimal, mode As System.MidpointRounding) As Decimal':
Argument matching parameter 'd' narrows from 'String' to 'Decimal'.
Argument matching parameter 'mode' narrows from 'Integer' to 'MidpointRounding'.
'Public Shared Function Round(d As Decimal, decimals As Integer) As Decimal':
Argument matching parameter 'd' narrows from 'String' to 'Decimal'.
於 Microsoft.VisualBasic.CompilerServices.OverloadResolution.ResolveOverloadedCall(String MethodName, List`1 Candidates, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure)
於 Microsoft.VisualBasic.CompilerServices.OverloadResolution.ResolveOverloadedCall(String MethodName, MemberInfo[] Members, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure)
於 Microsoft.VisualBasic.CompilerServices.NewLateBinding.ResolveCall(Container BaseReference, String MethodName, MemberInfo[] Members, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure)
於 Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
於 wsERP2004.fm_QC_Raw_Sampling_W.fm_QC_Raw_Sampling_W_Load(Object sender, EventArgs e)
於 System.Windows.Forms.Form.OnLoad(EventArgs e)
於 System.Windows.Forms.Form.OnCreateControl()
於 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
於 System.Windows.Forms.Control.CreateControl()
於 System.Windows.Forms.Control.WmShowWindow(Message& m)
於 System.Windows.Forms.Control.WndProc(Message& m)
於 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
於 System.Windows.Forms.ContainerControl.WndProc(Message& m)
於 System.Windows.Forms.Form.WmShowWindow(Message& m)
於 System.Windows.Forms.Form.WndProc(Message& m)
於 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
於 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
於 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)...
Read more.
之前在VS2003 .NET 1.1 Run的好好的程式,因為昇級到了VS2005 .NET 2.0 Sp2的環境之後
產生的錯誤訊息,因為VS2005之後就可以使用Math.Round這個Function所以大概只有昇級完會碰到這個問題吧,而且在編譯時不會有任何的錯誤,是在Run Time才會發現,所以才頭痛啊,言歸正傳
Decimal.Round只接受傳入的值為Decimal所以轉型一下就ok囉
Dim txt As Decimal = Ctype(txt.Tostring(), Decimal)
Decimal.Round(txt, 2).ToString()
如需叫用 Just-In-Time (JIT) 偵錯的詳細資料,
請參閱本訊息結尾處 (而非這個對話方塊) 的資訊。
************** 例外狀況文字 **********
System.Reflection.AmbiguousMatchException: Overload resolution failed because no Public 'Round' can be called without a narrowing conversion:
'Public Shared Function Round(d As Decimal, mode As System.MidpointRounding) As Decimal':
Argument matching parameter 'd' narrows from 'String' to 'Decimal'.
Argument matching parameter 'mode' narrows from 'Integer' to 'MidpointRounding'.
'Public Shared Function Round(d As Decimal, decimals As Integer) As Decimal':
Argument matching parameter 'd' narrows from 'String' to 'Decimal'.
於 Microsoft.VisualBasic.CompilerServices.OverloadResolution.ResolveOverloadedCall(String MethodName, List`1 Candidates, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure)
於 Microsoft.VisualBasic.CompilerServices.OverloadResolution.ResolveOverloadedCall(String MethodName, MemberInfo[] Members, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure)
於 Microsoft.VisualBasic.CompilerServices.NewLateBinding.ResolveCall(Container BaseReference, String MethodName, MemberInfo[] Members, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, BindingFlags LookupFlags, Boolean ReportErrors, ResolutionFailure& Failure)
於 Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
於 wsERP2004.fm_QC_Raw_Sampling_W.fm_QC_Raw_Sampling_W_Load(Object sender, EventArgs e)
於 System.Windows.Forms.Form.OnLoad(EventArgs e)
於 System.Windows.Forms.Form.OnCreateControl()
於 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
於 System.Windows.Forms.Control.CreateControl()
於 System.Windows.Forms.Control.WmShowWindow(Message& m)
於 System.Windows.Forms.Control.WndProc(Message& m)
於 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
於 System.Windows.Forms.ContainerControl.WndProc(Message& m)
於 System.Windows.Forms.Form.WmShowWindow(Message& m)
於 System.Windows.Forms.Form.WndProc(Message& m)
於 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
於 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
於 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)...
Read more.







2009-09-11
[+/-] : 如何利用表單檔名(字串),動態叫出winform
先拜請了一下Goolge大神,得到一個網址
http://bauann-makeit.blogspot.com/2008/08/form.html
其中YourAssemblyName就是你的專案名稱
YourFormName就是你的Form的名字
如果你新建專案是用預設的名稱那就會是WindowsApplication1
表單是Form1
組合起來就是WindowsApplication1.Form1
看懂了嗎?...
Read more.
http://bauann-makeit.blogspot.com/2008/08/form.html
Dim myF As Form = _
CType(Activator.CreateInstance(System.Reflection.Assembly.GetExecutingAssembly.GetType("YourAssemblyName." & "YourFormName")), Form)
myF.ShowDialog()
其中YourAssemblyName就是你的專案名稱
YourFormName就是你的Form的名字
如果你新建專案是用預設的名稱那就會是WindowsApplication1
表單是Form1
組合起來就是WindowsApplication1.Form1
看懂了嗎?...
Read more.







訂閱:
文章 (Atom)