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


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

How can I prevent Line from crossing over the rectangle?

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :WPF
 

Hello Everyone,

 

I am working on something where I allow the user to drag shapes onto drawing panel and connect them through lines.

The shapes and lines can be grabbed using mouse and moved.

My requirement is that line should never cross the shapes. I tried doing this through conditions like checking X Y coordinates on mouse move but

soon found it to be tedious and error prone.

Is there any way that I let WPF take care of this on its own. Like some events that I can attach so the moment line comes over the shape it relocates back to previous location..

I have seen something like this in a coupe of examples but they use XAML file and I don't have a XAML in my application, need to do everything through code.

 

Thanks in advance :)




View Complete Post


More Related Resource Links

How do I stop line feeds in a Hierarchy field from a SharePoint list to prevent wrapping

  
I'm developing a Reporting Services 2005 report that includes a Hierarchy field from a SharePoint 2007 list.  The Data Source for the report is an XML type. I would like to display the Hierarchy field on 1 line.  However, it is displaying in 2 or more lines. The field also wraps when rendering to Acrobat (PDF) file.  How can I get rid of the embedded line feed (I believe it's "&#xA").  I've tried using the Replace function in an expression, other functions and changed the properties, e.g., the CanGrow property.  Nothing seems to work. Does anybody have any suggestions?  Thanks.

How do I stop line feeds in a Hierarchy field from a SharePoint list to prevent wrapping in a SSRS r

  
I'm developing a Reporting Services 2005 report that includes a Hierarchy field from a SharePoint 2007 list.  The Data Source for the report is an XML type. I would like to display the Hierarchy field on 1 line.  However, it is displaying in 2 or more lines in Visual Studio 2005. The field also wraps when rendering to Acrobat (PDF) file.  How can I get rid of the embedded line feed (I believe it's "&#xA").  I've tried using the Replace function in an expression, other functions and changed the properties, e.g., the CanGrow property.  Nothing seems to work.   Here's what I get: LAW>Administrative Law LAW>Criminal Law LAW>International Law   I'd like to see something like this (I'm able to add the "/"): LAW>Administrative Law /LAW>Criminal Law /LAW>International Law/

Article commenting by line number

  

I'm wondering what's the best way to approach an online article system that allows users to comment by clicking on the line they are commenting about? Essentially the same way Adobe Acrobat works with comments where you can click anywhere and the text is saved for that location.

I'm assuming a mix of jQuery would be the crux of the interface. The system would need to save comments so that when another user logs in, they will also see the other comments but they can´t edit them - only add their own.

Any suggestions would be great.


New off line application working with sdf file. Need advice

  

Hey Folks


I am working on a project currently where I need to get data out of a 3rd party vendor's software that uses a .sdf file I looked this up and its a SQL CE file. I was hoping to just link to with with access but thats apparently not going to happen. I need to link to the database extract data from it to a csv file for later use. I also and most important I need to get the data from it and create a report that can be printed while on a customers site that my or may not have web access so I need for this program to be on and off line. I had my webapplication that I have been working on open and was able to bring up the sdf file under the server exploere however I can't seem to get anything out of it when I try to do grid views or detail views errors out.


Can I use one of Visual Studio projects to create this sort of applicaiton if so what would be the best approach. I would love to get an access odbc driver since office is allready installed on the employee's laptop's


Thanks

Capjlp



Line Break Problem in XSLT

  

Hi All,

I want to add line break in the xslt but it not working.

Below is the code for adding the line break.

</P> <P>
&lt;xsl:variable name="Collection7"&gt;</P> <P>&nbsp; &lt;xsl:value-of select="$13932"/&gt;&lt;xsl:text&gt;&amp;#xa;&lt;/xsl:text&gt;</P> <P>&nbsp; &lt;xsl:value-of select="$31042"/&gt;&lt;xsl:text&gt;&amp;#xa;&lt;/xsl:text&gt;</P> <P>&lt;/xsl:variable&gt;</P> <P>&lt;td&gt;&lt;xsl:value-of select="$Collection7"/&gt;&lt;/td&gt; </P> <P>&lt;/code]</P> <P>I have tried the below code as well:</P> <P>&lt;xsl:variable name="newline"&gt;
&lt;xsl:text&gt;
&lt;/xsl:text&gt;
&lt;/xsl:variable&gt;</P> <P>or</P> <P>&lt;xsl:variable name="break"&gt;&amp;lt;br&amp;gt;&lt;/xsl:variable&gt;</P> <P>or </P> <P>addign &lt;br/&gt;</P> <P>then also it not adding the line break.</P> <P>But If I write code like below then it is adding the line break and it works fine.</P> <P>

crystal report -visual studio 2008 dual axis chart (bar & line)

  

dear all, 

i use crystal report integrated with  vs.2008, and i want to make chart with dual axis (bar & line).

i have used bar chart and input the data with 2 values..

then in chart options > template, i activated the dual axis..

my question is, how i can change the 2nd value with line chart not bar chart??

i'd tried to find the right settings in "chart options" but still can't find the solution.


for information in "chart options" there are 4 sub menu : template, general,titles,grid..

i read in a tutorial there's more sub menu called "series" in crystal report (stand alone version)..

is it possible doing it in Crystal Report VS. 2008?

please,, i need your advice and solution..

Thanx before..

Regards..



Extreme UI: Line Charts with Data Templates

  

Charles Petzold continues his investigation into robust XAML coding made possible by Windows Presentation Foundation, this time tackling the complicated process of creating line charts.

Charles Petzold

MSDN Magazine January 2010


Silverlight: Build Line-Of-Business Enterprise Apps With Silverlight, Part 2

  

Here we wrap up the call center client application we began last month. The techniques we illustrate will help you build real-world enterprise solutions using Silverlight.

Hanu Kommalapati

MSDN Magazine February 2009


Silverlight: Build Line-Of-Business Enterprise Apps With Silverlight, Part 1

  

Take a walk through the creation of a call center client application to learn how to build real-world enterprise solutions using Silverlight.

Hanu Kommalapati

MSDN Magazine January 2009


Debug Leaky Apps: Identify And Prevent Memory Leaks In Managed Code

  

When is the .NET Garbage Collector unable to reclaim memory? The answer might surprise you. Stay tuned.

James Kovacs

MSDN Magazine January 2007


Add an empty line in Gridview on specific dayofweek

  

Hey all,

Havin quite a bit of trouble with this one.  I have a bunch of days that I worked in my database...mostly monday-friday and some saturdays.  What I want the gridview to do is add an empty line between each sunday and monday so that it seperates out my work weeks and makes it easier to read in the gridview.  I got some help here a few days ago on how to clone the db etc and I have all that working properly but I can't seem to wrap my head around how to do add these empty lines in the proper spots.  Here is my code so far:

private DataTable AddEmptyRow()
    {
        DataTable originalDataTable = GetItems();
        DataTable newDataTable = originalDataTable.Clone();
        DateTime testdate = Convert.ToDateTime("7/20/2010");

            for (int i = 0; i < originalDataTable.Rows.Count; i++)
            {
                DayOfWeek day = testdate.DayOfWeek;


                if (day == DayOfWeek.Sunday)
                {
                    DataRow newDataRow = newDataTable.NewRow();
                    newDataTable.Rows.Add(newDataRow);
                    newDataTable.ImportRow(originalDataTable.Rows[i]);

                }
                else
                {
                    newDataTable.ImportRow(originalDataTable.Rows[i]);
                }



             

Prevent loading big images ..

  

Hi


i need to prevent loading big images e.g max 100KB

but i only store url


1. user put url with image (i remember this string in database not image itself)

this cause that i can not check image size before store url in database

because user can store url and after this operation put bigger file at that location)

2. my web page generate some different image based on first image


and i need to load portion of image 

to stream and set buffer size to 100KB + 1 Byte

if stream is larger than 100KB that user put bigger file 

how can i accomplish that?


FileStream can not use URI as location only disc location

what should i use instead?


please help,

Karol Bieniaszewski



KeepTogether=false on table not working within rectangle

  

I have an rdlc report that has a table contained within a rectangle. Since I have multiple data sections within the BODY of the report, I am using rectangles to keep them separated.

Anyway, the problem is that <KeepTogether> set to false on the table is not working when the table is contained within the rectangle, causing unwanted page breaks and acting as though KeepToghther is always true. The rectangle does not have <KeepTogether>.  When the table is outside the rectangle everything works fine.

Any ideas?

Thanks 

 


Autoscroll down to a specific line on the webpage

  

Hi,

I wonder about how this autoscroll is working on a page. For example when entering a page that I have set up named "test.aspx",

I want to 'autoscroll' down to a specific textrow that I have so that textrow exactly will be on the very top of the browser window.

 

I wonder how you do this task? Thanks! 


Prevent Concurrent Logins ? [ Already logged in or currest session is still active implementation] ?

  

Hi Experts ,

I searched over the web but no luck so far and thought of getting some help form gurus .

Did any out really implemented a way to handle concurrent logins ?

Please not that i'm no using either forms authentication or Roles/Memberships , I do have custom authentication for my website .

I'm sure it is someway related  with global.asax file handling something in application events and session events but unable to figure this one out .

Any pointers will highly be valued and appreciated .

Thanks a tonne in advance .


Whats wrong with this code, im getting blue line under the createStatus next the switch

  
Error message: Use of unassigned local variable 'createStatus'
 
            MembershipCreateStatus createStatus;
            MembershipUser newUser = Membership.CreateUser(Username.Text, Password.Text, Email.Text);

            switch (createStatus)
            {
                case MembershipCreateStatus.Success:
                    this.CreateAccountResults.Text = "The user account was successfully created!";
                    break;
                case MembershipCreateStatus.DuplicateUserName:
                    this.CreateAccountResults.Text = "There already exists a user with this username.";
                    break;
                case MembershipCreateStatus.DuplicateEmail:
                    this.CreateAccountResults.Text = "There already exists a user with this email address.";
                    break;
                case MembershipCreateStatus.InvalidEmail:
                    this.CreateAccountResults.Text = "There email address you provided in invalid.";
                    break;
                case MembershipCreateStatus.InvalidPassword:
                    this.CreateAccountResults.Text = "The password you provided is invalid. It must be seven characters long and have at least one non-a
Categories: 
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