This blog is subject the DISCLAIMER below.

Friday, May 23, 2008

WorldWide Telescope: The Universe at Your Fingertips

WWT_Embroidery_500w

Microsoft launched its WorldWide Telescope, bringing the free Web-based program for zooming around the universe to a broad audience.

WorldWide Telescope, enables anybody with a Web connection to browse through the universe, to explore distant galaxies, to dance among the stars. A state-of-the-art combination of software and Web 2.0 services, WorldWide Telescope offers terabytes of high-resolution images, astronomical data, and guided tours that bring the universe to your fingertips.

Lots of computer applications offer to add value to your life. WorldWide Telescope, available for download, delivers the sun, the moon, and the stars—for free.

wwt1

"The WorldWide Telescope is a powerful tool for science and education that makes it possible for everyone to explore the universe," said Bill Gates, Microsoft's chairman, in a statement.

Link:

http://www.worldwidetelescope.org

Others links:

http://research.microsoft.com/news/featurestories/publish/WorldWideTelescope.aspx?0hp=n2

http://www.istartedsomething.com/20080513/capturing-screenshots-from-worldwide-telescope/

.. more.

Tuesday, May 20, 2008

dotNetWork.org 4th gathering


31 May 2008

12:00 PM – 4:00 PM

Speakers
Marwan Tarek

MOSS MVP - Team leader - ITWorx.


Hussien Zahran

Development Manager - Link Development.

Agenda
12:00 - 01:30: SharePoint Development by Marwan Tarek
Marwan will give us an overview about SharePoint development. This session will be first session of a SharePoint sessions series.

1:30 PM – 2:00 PM: Coffee Break

2:00 PM – 3:30 PM: Introduction to Silverlight by Hussien Zahran
Hussien will talk about Silverlight. Silverlight™ is the Microsoft® cross-browser, cross-platform, and cross-device plug-in for delivering the next generation of media experiences and rich interactive applications for the Web.

3:30 PM – 4:00 PM: Lunch



Canadian International College
Busses will be available at: Nady El-Sekka (11:00 AM - 11:30 AM)

.. more.

Sunday, May 18, 2008

How to delete all data from controls in opened forms using C# ???

I will separate this problem into two tasks :
I- Delete all data from one form ( main form )
II- Reaching to other open forms and delete their data .
but before starting , first create a form contain
some combo box ,text box , labels and one button
I- Delete all data from one form ( main form ) :

insert this code in the button you created ( clear button )




private void Clear_Click(object sender, EventArgs e)

{

Control.ControlCollection cc;
cc = this.Controls; // to get all controls of your form

foreach (Control ctrl in cc)

{

string type = ctrl.GetType().ToString();
switch (type)
{
case "System.Windows.Forms.ComboBox":

ComboBox cb = ctrl as ComboBox;

cb.SelectedIndex = -1;

break;

case "System.Windows.Forms.TextBox":

TextBox tb = ctrl as TextBox;

tb.Clear();

break;

case "System.Windows.Forms.Label":

Label L = ctrl as Label;

L.Text = "";

break;

}

}

}



II- Reaching other open forms and delete their data :

its the easy part , just replace one line code and add a for loop .

replace this line :

cc = this.Controls;

with this line :

cc = Application.OpenForms[i].Controls;

* Application.openforms[i] to reach to all open forms





private void Clear_Click(object sender, EventArgs e)

{

for (int i = 0; i <>

Control.ControlCollection cc;

cc = Application.OpenForms[i].Controls;

//cc = this.Controls;

// previous code
}

}

}


.. more.

Friday, May 16, 2008

How to make your controls moveable?

Q: How to make your controls moveable?


A: Some people need to add style to their controls to be moveable that's users can drag and drop them anywhere on the form.So, when user presses on a control and moves the mouse; control location should equal mouse axis.

Some variables used in our code.


/// <summary>
/// Indicates whether control is pressed by mouse or not
/// </summary>
bool IsDraged = false;

/// <summary>
/// Holds the X-coordinate of the control
/// </summary>
int Control_X = 0;

/// <summary>
/// Holds the Y-coordinate of the control
/// </summary>
int Control_Y = 0;


This is the mouse down event handler, we just checked the left button is pressed then set boolean variable IsDraged to true and assigned control location to mouse location.


private void Control_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
IsDraged = true;
Control_X = e.X;
Control_Y = e.Y;
}
}


Just when mouse left button released we set IsDraged to false.


private void Control_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
IsDraged = false;
}
}


Here's when mouse moves while mouse left button not released yet, the computation used helps controls to move smoothly with the mouse movement.


private void Control_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Control active = (Control)sender;
if (IsDraged)
{
active.Left += e.X - Control_X / 12;
active.Top += e.Y - Control_Y / 12;
Control_X = e.X;
Control_Y = e.Y;
}
}
}

.. more.