Window Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 16 February 2008

WPF for Dummies :)

Posted on 22:38 by Unknown

Hello everyone..

Here I am giving a very basic XAML demo, especially for those lovely developers who have not yet code a single line in XAML, and who are just aware of XAML..well..its pretty simple..If you are using Visual Studio.NET 2005, you need to Download SDK for it, If you are using Orcas/VS2008 Beta2/VS RTM..then Life is easy for you as all the stuff is built-in.

You need to choose WPF application from File-> New -> Project

This will throw you in IDE and then you need to just play in XAML tab just next to Design.


<Grid>


<Button x:Name="Vikram"
Height="50" Width="200" Content="Click">


</Button>


</Grid>


 

This will allow you to put simple button on. On similar lines you can add Textbox also, so for adding textbox,you need to write following code.


 

<TextBox x:Name="Mytxt" Height="50" Margin="39,35,39,0" VerticalAlignment="Top"></TextBox>


 

So, lets do some more fun with this..lets rotate both in 45 Degrees..so you will now have to write down the Transform for this..This is how we do it.


 

<Grid>


<Button x:Name="Vikram" Content="Click" Height="50" Width="200"
>


<Button.RenderTransform>


<RotateTransform Angle="45">


</RotateTransform>


</Button.RenderTransform>


</Button>


<TextBox x:Name="Mytxt" Height="50" Margin="39,35,39,0" VerticalAlignment="Top">


<TextBox.RenderTransform>


<RotateTransform Angle="45">


</RotateTransform>


</TextBox.RenderTransform>


</TextBox>


</Grid>


 

So..here it is..First WPF application with XAML is ready to run!!


 

Hope..you will njoy those small codes..will come up with more soon..


 

Vikram

Read More
Posted in | No comments

Tuesday, 12 February 2008

Retain Password in ViewState

Posted on 06:43 by Unknown
Recently, while working on one assignment, there was a total new and funny situation I came across. I was working on User Registration Page, It was typical User Registration Page.

First few fields was like Username,Firstname etc. then it was Password field. Below that I was filling two combo boxes of City and State which was dependable on each other..So I was not having any choice but to post them back and fire SelectedIndex change event..All of the other information like Username,Firstname was in state and were able to retain their values which I key in them..but
don't know how..Password field was getting blank again and again.

One of my friend told me that this is because of Security reason,that we lost value in Password Textbox in Postback of page..Some people told me that its next to impossible to retain Password value in Postbacks and might be dangerous and against security policies.

But..I was not having choice as it was my task..so I tried out whole tons of experiment..All Sessions, Varibles,Constants,JavaScripts,HiddenFields,Enable ViewState..all stuff got simply failed..I was like no where..I then Google it..done few hits on Live engine and Yahoo..

Suddenly,I came across ViewState declarations on some forums..and It clicked.!!
I just wrote following piece of code and my 3 days research work got over finally..

ViewState["MyPassword"] = txtPassword.Text;
txtPassword.Attributes.Add("value",ViewState["MyPassword"].ToString());


and done with it..!!

Vikram.

Read More
Posted in | No comments

Visit to Microsoft,Mumbai

Posted on 06:27 by Unknown
Hi

It was a damm wonderful time last week..last weekend I went to Mumbai for MSP Boot Camp..MSP is Microsoft Student Partner..though I am not MSP but I went there on behalf of PuneUserGroup with whom I am from last 2 years.

It was total fun..and great learning exprience for me and my UG fellows.I attended "Soft skills" session by Sarang Datye who is MS employee,Then I attended Sanjay Vyas Session on "Power of Visuals", Then MVP Nauzad took quick and wonderful session on "WebServices in ASP.NET".

I played lot of games on XBOX there..there was a separate room for that..We after our session had total fun at our Hotel till Midnight 2 PM..we were shouting,Dancing,Singing Songs..loads of fun.It was very good exprience.

And how can I miss my journey from Pune to Mumbai with Sarang and Mahesh..we twice lost our road..we were just roaming on same road for 1 Hr..were totally confused by flyovers..and Most funny part was we were standing in front of Microsoft building..just few distance away..building was visible..but still..Mumbai roads and we were newbies..so it took us 20 mins..till that time we just moving round n round around the building..

Lovely journey overall..!! :)

Vikram.
Read More
Posted in | No comments

Wednesday, 6 February 2008

Arrow Key Navigation in Textboxes

Posted on 09:49 by Unknown

Hello everyone,

Well I decided today that instead of posting total theory stuff, lets do some hands around and coding..Few days ago..I had requirement which stated that when user press Down arrow and Up arrow, cursor should move accordingly in ASP.NET Form..It took my brain off for a while to implement such Javascript in this dynamically created Textboxes..but finally done with it.

Its working with Mozilla too ;)

HTML Code :

<head
runat="server">


<title>My Arrow Key Demo</title>

<script
language="javascript"
type="text/javascript"
>


function keyPressed(TB,e)

{


if(e.keyCode == 40 || e.keyCode == 13)

{


var i = parseInt(TB.substring(7,8)) + 1

document.getElementById("TextBox"+i).focus()

}


if(e.keyCode == 38)

{


var i = parseInt(TB.substring(7,8)) - 1

document.getElementById("TextBox"+i).focus()

}

}

</script>

</head>

<body>


<form
id="form1"
runat="server">


<div>


<br
/>


<asp:Table
ID="DataEntry1"
style="height:141px; background:#F7F7F7"
cellpadding="1"
border="1"
cellspacing="1"
runat
="server"
>


</asp:Table>


</div>


</form>

</body>

</html>


 

.NET Code


 

Protected
Sub Page_Load(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
Me.Load


Try


Dim i As
Integer


For i = 1 To cnt


Dim tcell As
New TableCell


Dim trow As
New TableRow


Dim txtbx As
New TextBox

txtbx.ID = "TextBox" + i.ToString()

         'Add JavaScript to Textbox

txtbx.Attributes.Add("onkeyup", "keyPressed(this.id,event)")

txtbx.Width = 60

txtbx.Height = 13

tcell.Controls.Add(txtbx)

tcell.Width = 61

trow.Cells.Add(tcell)

trow.Style.Add("Align", "Center")

DataEntry1.Rows.Add(trow)


Next


Catch ex As Exception

Response.Write(ex.Message.ToString())


End
Try


End
Sub

Thats it...till the day we came across how to make Button as Default.Tab navigation which is by default..and here it is...ArrowKey navigation in Form.


 

Vikram Pendse.

Read More
Posted in | No comments

Sunday, 3 February 2008

Hello World !!

Posted on 19:39 by Unknown
Keeping the tradition..lets start with

"Hello World" :)

Vikram.
Read More
Posted in | No comments
Newer Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • First Windows Phone 7 update February 2011 - Small update but Big start
    After tons of rumors and set of predictions on Windows Phone 7 all over Internet, Microsoft came up with first Windows Phone 7 minor update ...
  • The little Story of “I Unlock Joy” event by Microsoft and Pune User Group
      This post is about recent “I Unlock Joy” event happened in Pune which was conducted by Microsoft and Pune User Group. Little History : ...
  • Silverlight On Mobile : Windows Phone 7 Splash Screen and Customization
    After talking about 3D capabilities on Windows Phone 7 using Silverlight in last article , Now I am moving ahead with small but equally impo...
  • Silverlight 5 : Platform Invoke (PInvoke) in Silverlight
      Two days back Microsoft announced availability of Silverlight 5 RC,I encourage you to download bits from here , My friend Pete Brown alr...
  • Introduction to Speech Capabilities in Windows Phone 8 – Part 1
    After a long..I am writing blog, I hope and I wish I will resume blogging like I use to in past. Lots of things happened in past few months....
  • MCTS : Microsoft Silverlight 4 Development Exam Guide (70-506) by Packt Publishing
      Hello, After a long time I got chance to come back here.I will soon resume blogging in month of August. Last 4-5 months were horrible due...
  • Introduction to Speech Capabilities in Windows Phone 8 – Part 2
    Hope you enjoyed my last article on Speech Capability in Windows Phone 8, Today I am posting another part or you can say little extension t...
  • Silverlight 3 : Insert & Update Data using WCF Service with DataForm and DataGrid
    In my Lap around Silverlight 3 series, I have written a separate article on DataForm in Silverlight 3, This article is a basic extension to ...
  • Mango : Using DeviceStatus in Windows Phone 7.1
    First of all “Thank You” for your wonderful response and comments on my last article on Silverlight Vs HTML5 ,I hope you like the points I ...
  • Silverlight, HTML5 & Windows 8 : Where we are heading to ?
    This is not the post or yet another post on most happening debate of Silverlight and HTML5, This is just a visit to all of them to realize t...

Blog Archive

  • ►  2013 (4)
    • ►  August (1)
    • ►  April (3)
  • ►  2012 (4)
    • ►  July (1)
    • ►  March (2)
    • ►  January (1)
  • ►  2011 (24)
    • ►  December (1)
    • ►  September (4)
    • ►  August (2)
    • ►  July (1)
    • ►  June (4)
    • ►  May (3)
    • ►  April (3)
    • ►  March (1)
    • ►  February (4)
    • ►  January (1)
  • ►  2010 (21)
    • ►  December (1)
    • ►  November (2)
    • ►  October (3)
    • ►  September (2)
    • ►  August (4)
    • ►  July (5)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  January (1)
  • ►  2009 (49)
    • ►  December (1)
    • ►  November (5)
    • ►  October (2)
    • ►  September (1)
    • ►  August (5)
    • ►  July (5)
    • ►  June (1)
    • ►  May (5)
    • ►  April (5)
    • ►  March (9)
    • ►  February (4)
    • ►  January (6)
  • ▼  2008 (43)
    • ►  December (3)
    • ►  November (9)
    • ►  October (7)
    • ►  September (4)
    • ►  August (2)
    • ►  July (3)
    • ►  June (4)
    • ►  May (3)
    • ►  March (3)
    • ▼  February (5)
      • WPF for Dummies :)
      • Retain Password in ViewState
      • Visit to Microsoft,Mumbai
      • Arrow Key Navigation in Textboxes
      • Hello World !!
Powered by Blogger.

About Me

Unknown
View my complete profile