Feedback Form

Wednesday, February 27, 2008

Pure Chat sample

As axosoft company said on their website:
PureChat is one of the most attractively priced live web chatting solutions on the market.

I see its very simple one, it a good choice if:
Your budget is not a lot
You don't want any advanced communication between your operators and users.
You don't want file transfer or sharing.

Its very simple and clear.

I made a small sample using pure chat, its very simple and working nice.

Download sample

How to make your own read this


kick it on DotNetKicks.com

Monday, February 18, 2008

Ooops i closed the wrong tab (firefox)

Some times we close the wrong tab in firefox browser, what can we do :(
Its simple:
Press:

Ctrl+Shift+T (firefox windows)
Cmd+Shift+T (firefox mac)

Cool :) .....

Friday, February 08, 2008

SlideShowExtender Fade effect

You can make fade effect while sliding and there is a good way by using SlideShowExtender + AnimationExtender like the following good sample:

<%@ Page Language="C#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
[System.Web.Services.WebMethod]
public static AjaxControlToolkit.Slide[] GetSlides()
{
return new AjaxControlToolkit.Slide[] {
new AjaxControlToolkit.Slide("AjaxToolKit/SliderShowImages/Blue hills.jpg", "Blue Hills", "Go Blue"),
new AjaxControlToolkit.Slide("AjaxToolKit/SliderShowImages/Sunset.jpg", "Sunset", "Setting sun"),
new AjaxControlToolkit.Slide("AjaxToolKit/SliderShowImages/Winter.jpg", "Winter", "Wintery..."),
new AjaxControlToolkit.Slide("AjaxToolKit/SliderShowImages/Water lilies.jpg", "Water lillies", "Lillies in the water"),
new AjaxControlToolkit.Slide("AjaxToolKit/SliderShowImages/VerticalPicture.jpg", "Sedona", "Portrait style picture")};
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
var fadein;
var fadeout;

function pageLoad()
{
var ss=$find("ss1");
ss.add_slideChanging(onChanging);

var ae=$find("ae");
var be=ae.get_OnLoadBehavior();
var an=be.get_animation();
fadein=an.get_animations()[1];
fadeout=an.get_animations()[0];

fadein.set_duration(0.5);
fadeout.set_duration(0.5);
}
function onChanging(sender, args)
{
fadein.play();
window.setTimeout("fadeout.play()", 1000);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptLocalization="true" EnableScriptGlobalization="true">
</asp:ScriptManager>
<asp:Image ID="Image1" runat="server"
Height="300"
Style="border: 1px solid black;width:auto"
AlternateText="Blue Hills image" />
<ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server"
TargetControlID="Image1" BehaviorID="ss1"
SlideShowServiceMethod="GetSlides" PlayInterval="2000"
AutoPlay="true"
Loop="true" />
<ajaxToolkit:AnimationExtender id="MyExtender" runat="server" BehaviorID="ae" TargetControlID="Image1">
<Animations>
<OnLoad>
<Sequence>
<FadeOut Duration="0" Fps="20" />
<FadeIn Duration="0" Fps="20" />
</Sequence>
</OnLoad>
</Animations>
</ajaxToolkit:AnimationExtender>
</form>
</body>
</html>

Download Sample
Reference

Monday, February 04, 2008

SlideShowExtender Set Current Image Index, Src

I wanted to set the SlideShowExtender current image, i found just one good way to do so using simple java script code

1- Add the SlideShowExtender:

<cc1:SlideShowExtender BehaviorID="behaviorID" ID="SlideShowExtender1" runat="server"
SlideShowServiceMethod="GetSlides" PlayInterval="9000" TargetControlID="imgScreen"
UseContextKey="True" AutoPlay="true" Loop="true">
</cc1:SlideShowExtender>


2- Add the following java script code:

function changeImage(imgUrl, imageIndex){
slider1 = $find("behaviorID");
slider1._currentIndex = imageIndex-1;
slider1.setCurrentImage = imgUrl;
}

kick it on DotNetKicks.com

Friday, February 01, 2008

SlideShowExtender on slide change

How to add an onchange event to the SlideShowExtender?

-After adding your SlideShowExtender, assign the image control to it and setting a BehaviorID

<cc1:SlideShowExtender BehaviorID="behaviorID" ID="SlideShowExtender1" runat="server" SlideShowServiceMethod="GetSlides" PlayInterval="5000" TargetControlID="imgScreen"  UseContextKey="True" AutoPlay="true" Loop="true"></cc1:SlideShowExtender>

-Add the following java script code inside your html code file:

<script language="javascript" type="text/javascript">  
    function pageLoad(){ 
        var slider1;  
        slider1 = $find("behaviorID"); 
        slider1.add_slideChanging(onSlideChanging);  
    }
     function onSlideChanging(sender, args){ 
        currentSlideIndex = args.get_slideIndex();  
        //Do what you want using this index
     }
</script>



kick it on DotNetKicks.com

Get Difference between 2 times in milliseconds

I got that the best class to get the difference between 2 times in .Net framework is System.Diagnostics.Stopwatch class.

Dim sw As New System.Diagnostics.Stopwatch()
sw.Start()
Threading.Thread.Sleep(2)
MessageBox.Show(sw.ElapsedMilliseconds.ToString())

kick it on DotNetKicks.com


Excel file in new excel instance

You can open any excel file using code like this:

Process.Start(filePath);

But what will happen if we have these 2 lines of code:

Process.Start(filePathONE);

Process.Start(filePathTWO);

Will first open “filePathONE” in a new excel instance, then will open the “filePathTwo” in the same excel instance.

What we can do if we want to open each file in a separate new excel instance?

We must write it like that:

Process.Start(“Excel.exe”, filePathONE);

Process.Start(“Excel.exe”, filePathTWO);

It’s very simple, isn’t it?

But we can face a small problem with this way:

If you want to open an excel file that contains space in its name, for example “my Sheet.xls”, it will give you a runtime error that it can’t open files “my.xls” and “Sheet.xls”.

So what can I do?

It’s simple:

Just add “ before and after the file path, just like that:

Process.Start(“Excel.exe”, @“””filePathONE”””);

Like that it will open normally without any errors.

Note:

You will need to do the same for any office application (word, powerpoint, ….).

kick it on DotNetKicks.com

Access splash screen

How to add a splash screen that closes after 10 seconds before my main form starts?

Here is one way:
1. Place the form that has the splash screen in design view and set the following properties:
Timer Interval 6000
On Timer>>>>>>Click the build button to create an event procedure. Place the following code in that procedure:
________________________________________
Private Sub Form_Timer()
On Error GoTo Error_Routine
' Form stays open for 10 seconds, then closes.
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "frmMainSwitchboard"
Exit_Continue:
Exit Sub
Error_Routine:
MsgBox "Error# " & Err.Number & " " & Err.Description
Resume Exit_Continue
End Sub
______________________________________________
2. Go to Startup properties on the Access Command menu tools>Startup and select the splash screen as the form hat opens at startup. Then test by restarting your application access file.



kick it on DotNetKicks.com