Private Function GetFormByName(ByVal formName As String) As Object
Dim myasm As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
Try
Return myasm.CreateInstance(myasm.GetName.Name.Replace(" ", "_") & "." & formName)
Catch ex As Exception
Return Nothing
End Try
End Function
Source : http://www.tek-tips.com/faqs.cfm?fid=6037
Minggu, 21 Desember 2008
Get Form by Name (1)
Imports System.Reflection
Imports System.windows.forms
'Creates form from form name - CASE SENSITIVE
Public Shared Function GetFormByName( _
ByVal formName As String) As Form
Dim assemblyName As String = _
[Assembly].GetEntryAssembly().GetName.Name.Replace(" ", "_")
Dim myType As Type = _
Type.GetType(assemblyName & "." & formName)
Return CType(Activator.CreateInstance(myType), Form)
End Function
Imports System.windows.forms
'Creates form from form name - CASE SENSITIVE
Public Shared Function GetFormByName( _
ByVal formName As String) As Form
Dim assemblyName As String = _
[Assembly].GetEntryAssembly().GetName.Name.Replace(" ", "_")
Dim myType As Type = _
Type.GetType(assemblyName & "." & formName)
Return CType(Activator.CreateInstance(myType), Form)
End Function
Kamis, 18 Desember 2008
Formatting a Date in a DataList
There are two ways to format the date in datalist of asp.net.
1. Parsing Date At ASPX page
<%#DateTime.Parse(Eval("DateColumnName").ToString()).ToString("MMM dd, yyyy")%>
2. Try this <%# Eval("EventStartDate","{0:MMMM dd, yyyy}") %> or
<%# Eval("EventStartDate","{0:d}") %>
1. Parsing Date At ASPX page
<%#DateTime.Parse(Eval("DateColumnName").ToString()).ToString("MMM dd, yyyy")%>
2. Try this <%# Eval("EventStartDate","{0:MMMM dd, yyyy}") %> or
<%# Eval("EventStartDate","{0:d}") %>
Senin, 08 Desember 2008
Menu - Eliminate The Triangular Arror pointer thing - How to do it?
Problem :
I want to eliminate the little triangular arrow poinger that appears tot he
right of the menu item. Which control setting lets me do that.
Solution :
you can get rid of the images if you set:
StaticEnableDefaultPopOutImage="False" or
DynamicEnableDefaultPopOutImage="False". To move the items one step
down you can set ShowStartingNode="False" of the sitemapdatasource.
Comment :
re:
re:
The arrowhead can also be replaced with a different image by settinging StaticPopOutImageUrl
(or DynamicPopOutImageUrl for a submenu) and providing a URL to the image.
There's many other programmable items in the menu control.
A list ( with sample code for some ) is available at:
http://msconline.maconstate.edu/Tutorials/ASPNET2/ASPNET10/aspnet10-02.aspx
Original : http://www.codenewsgroups.net/group/microsoft.public.dotnet.framework.aspnet.webcontrols/topic16144.aspx
I want to eliminate the little triangular arrow poinger that appears tot he
right of the menu item. Which control setting lets me do that.
Solution :
you can get rid of the images if you set:
StaticEnableDefaultPopOutImage="False" or
DynamicEnableDefaultPopOutImage="False". To move the items one step
down you can set ShowStartingNode="False" of the sitemapdatasource.
Comment :
re:
> StaticEnableDefaultPopOutImage="False"
That works for main menu items.re:
> DynamicEnableDefaultPopOutImage="False".
That works for submenus.The arrowhead can also be replaced with a different image by settinging StaticPopOutImageUrl
(or DynamicPopOutImageUrl for a submenu) and providing a URL to the image.
There's many other programmable items in the menu control.
A list ( with sample code for some ) is available at:
http://msconline.maconstate.edu/Tutorials/ASPNET2/ASPNET10/aspnet10-02.aspx
Original : http://www.codenewsgroups.net/group/microsoft.public.dotnet.framework.aspnet.webcontrols/topic16144.aspx
Langganan:
Komentar (Atom)
