.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Finding the X, Y coordintaes of a shape

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :WPF
I have a an array of Rectangles (lstRectangles()) in a Canvas (myCanvas) and want to report on screen the topleft  coordinates in a label. I have got this far (see below) but it returns tha values of 0,0. Dim myPoint As Point myPoint = lstRectangles(intI).TranslatePoint(New Point(0,0), myCanvas) myLabel.Content = myPoint.X & myPoint.Y At this point I have just displayed the rectangle(intI) from a loop, so don't know why it reports the coords as 0,0 Any help would be appreciated. Miswod

View Complete Post

More Related Resource Links

Finding Rows in ADO.NET

ADO.NET implements three basic forms to locate Rows - The Find method as applied to the Rows collection, the Find method as applied to the DataView object and the Contains method as applied to the Rows collection.

DataRowCollection Find and Contains Method

The DataRowCollection is a major component of the DataTable. While the DataColumnCollection defines the schema of the table, the DataRowCollection contains the actual data for the table, where each DataRow in the DataRowCollection represents a single row.

You can call the Add and Remove methods to insert and delete DataRow objects from the DataRowCollection. You can also call the Find method to search for DataRow objects that contain specific values in primary key columns, and the Contains method to search character-based data for single words or phrases.

DataView Find and FindRows Method

Using the Find and FindRows methods of the DataView, you can search for rows according to their sort key values. The case-sensitivity of search values in the Find and FindRows methods is determined by the CaseSensitive property of the underlying DataTable. Search values must match existing sort key values in their entirety in order to return a result.

Finding username


Im running a query where it selects a property from the user with the matching username but i dont know how to find out the username of the currently loggedin user.

Please Help!

Foundations: Vector Graphics and the WPF Shape Class


The System.Windows.Shapes namespace is Charles Petzold's namespace of choice for rendering two-dimensional vector graphics in WPF. Here he explains why.

Charles Petzold

MSDN Magazine March 2008

{ End Bracket }: Finding the Best of the Best


Passion, intelligence, and the love of learning exemplify the ideal Microsoft candidate. Howard Dierking explores these and other recruiting philosophies.

Howard Dierking

MSDN Magazine February 2008

C++ at Work: IRegistrar, Finding Submenus, and More


This month DLL problems, context menus, MFC strings to managed C++, and more.

Paul DiLascia

MSDN Magazine October 2006

Review It: Expert Tips for Finding Security Defects in Your Code


Reviewing code for security defects is a key ingredient in the software creation process, ranking alongside planning, design, and testing. Here the author reflects over his years of code security reviews to identify patterns and best practices that all developers can follow when tracking down potential security loopholes. The process begins by examining the environment the code runs in, considering the roles of the users who will run it, and studying the history of any security issues the code may have had. After gaining an understanding of these background issues, specific vulnerabilities can be hunted down, including SQL injection attacks, cross-site scripting, and buffer overruns. In addition, certain red flags, such as variable names like "password", "secret," and other obvious but common security blunders, can be searched for and remedied.

Michael Howard

MSDN Magazine November 2003

C++ Q&A: Finding a Win32 Handle, HTML in CHtmlCtrl


This month Paul DiLascia discusses how to find windows with GetLastChild and outputting HTML with a C++ procedure equivalent to document.write.

Paul DiLascia

MSDN Magazine August 2003

Win32 Resources: Using C++ to Programmatically Retrieve a Global Cursor's Shape and ID


Getting global cursor information is useful when developing software that drives or gathers information about other UI-based applications, including information about a remote machine. This article describes a way to programmatically identify the current cursor's ID and bitmap at any point in time. The first technique described is based on polling for information and shows how to get the handle of the current global cursor. This handle will then allow you to get information about the cursor. You can also monitor WinEvents for changes to the global cursor.

Dmitri Klementiev

MSDN Magazine October 2001

Finding a control from a control collection



I'm trying to write a bit of code that will format all the numeric values in lables in my gridview. here's what i am doing right now:

On the RowDataBound Event, i create a row object for the row that is currently being bound.
then i go use the FindControl method to grab each label by name.

Problem is there's too many columns in this table and i really dont wnat to have to type it all out. Here's an example of what i am currently doing

' Get row being bound
Dim myRow = e.Row

' Get labes to be formatted
Dim lblMunicipalIncineration = CType(myRow.FindControl("lblMunicipalIncineration"), Label)

' format labels
If lblMunicipalIncineration IsNot Nothing Then
    If Not String.IsNullOrEmpty(lblMunicipalIncineration.Text) Then
        lblMunicipalIncineration.Text = FormatNumber(lblMunicipalIncineration.Text, 0, TriState.False, TriState.False, TriState.True)
    End If
End If

Can i use myRow.Controls to grab a list of all the controls and then somehow get a list of all labels in the collection and then use a for loop to go through and format each label?


Hi, I am migrating a code from ADO to ADO.NET. Here i am stuck with the SHAPE statement in sql query that is used in ADO. Please help me out with the equivalent code for ADO.NET   sql= " ((SHAPE { " + sql1+ " }  AS SECONDARY APPEND ";sql= sql+ " ({ " + sql2+ " } AS PROCEDURALSOURCE  RELATE 'STASKID' TO 'TASKID') AS PROCEDURALSOURCE, ";sql= sql+ " ({ " + sql3+ "  } AS TASKAREA RELATE 'STASKID' TO 'TASKID') AS TASKAREA, ";sql= sql+ " ({ " + sql4+ "  } AS REPEATS RELATE 'STASKID' TO 'STASKID') AS REPEATS, ";sql= sql+ " ({ " + sql5+ "  } AS SECONDARYUOM RELATE 'STASKID' TO 'TASKID') AS SECONDARYUOM)";sql= sql+ " AS SECONDARY RELATE 'TASKID' TO 'TASKID') AS SECONDARY";  where sql1, sql2, sql3, sql4, sql5 are complex select statements. It gives an invalid sql statement error in oracle db when i execute this. It would be great if some one helps me out with equivalent code in ado.net using datasets or some other thing. Thanks.

Create my own shape in WPF!!

Hello Everyone,   I am new to WPF, so little stuck here. I am working on a project where I need to create a shape depending on user input. A rectangle block with smaller blocks attached on each side with some text inside, where the text, number of attached boxes are dynamic. I need mouse events for these as well cause user can drag them aswell. I tried few samples with Thumbs, Shapes etc But I find it really difficult. Any code samples / specific tutorials could be a great help.   Thanks :)              

Finding correct "system.webServer / modules / add"

For example, in web.config you can use... <system.webServer>      <modules>         <remove  name="DefaultAuthentication"     />         <add     name="DefaultAuthentication"     type="System.Web.Security.DefaultAuthenticationModule" />      </modules>   </system.webServer> ...for getting rid of precondition="managedHandler". Where can I find the names and types of the other modules? I suspected that somewhere in the hierarchy there should be some XML describing the defaults. However, I cannot find it. Am I missing some machine.config, web.config file? Michael G. Schneider

WPF - Drawing the connected lines shape

I want something to draw like in WPF   ___________________________                                        |                                        |                                        | __________________________ | | | ___________________________                                         |                                         |                                         | ___________________________          

Finding a WPF control by Name in a Panel

How can I loop through the controls collection of a WPF panel and find a control by name?  The StackPanel1.Children(0).Name property does not exist. I looking for a method equivelent to this WinForm code... Friend Function DBX_FindControlByName(ByRef objContainer As Object, _   ByVal strControlName As String, _   ByRef objFoundControl As Control) As Boolean   Dim objControl As Control = Nothing   If Not IsNothing(objFoundControl) Then Return True   Try   'objContainer must be a controls collection like Me.Controls   For Each objControl In CType(objContainer, Control.ControlCollection)   If objControl.Name.ToUpper = strControlName.ToUpper Then objFoundControl = objControl   Exit For   Else   If objControl.HasChildren Then   'This control has children so it must be a container DBX_FindControlByName(objControl.Controls, strControlName, objFoundControl)   End If   End If   Next   Return True   Catch ex As Exception strErrMsg = "DBX_FindControlByName." & objControl.Name & ": " & ex.Message   End Try   End Function Thanks. Mike

Finding broken links in a web of Pages

I have a dozen sub-sites all with large Pages libraries of .aspx pages created and maintained under the Publishing features on  MOSS 2007.  Some links also go to Document libraries. How do I detect broken links within the web of .aspx pages? 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend