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


Top 5 Contributors of the Month
david stephan
Asad Ali
Fauzul Azmi
Post New Web Links

How to make a Cut-Out control?

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

I am learning WPF (v3, I think) and I need to make a reusable visual component that I *think* should be a usercontrol or a custom control, but there are just too many choices for the control implementation, for me to figure out how best/easiest to do this.  Plus, I cannot figure out how to do a certain aspect with WPF at all.

In short I need to make a simple "cut-out" shape-type control.  While the final piece is quite complex, I can make it out of pieces and clips of several instances of the two built-in shape controls (rectangle and ellipse).  This all works fine unless I want the background to be transparent.  

The reason that transparent is a problem is because of how I had to build it.  My shape has curved sections or "bends" in it, which means that at those bends, there is a convex boundary (the outer-curve) and a concave boundary (the inner-curve).  In order to make this inner-bending boundary I had to use an ellipse shape and reverse the  background and foreground colors, so that its background (the part outside the ellipse) matched the foreground of the rest of may shape, thus blending in with it.  Likewise the ellipse's foreground (the inside of the ellipse) matches the color of my shape's background, blending in seamlessly with it as well. &nbs


View Complete Post


More Related Resource Links

How can i make a WPF transparent group box control that is in the toolbox?

  
How can i make a WPF transparent Groupbox control that will show a picturebox image behind it? Thanks -civilwarrock

How to make a yes/no ComboBox user control

  
How to make a yes/no ComboBox user control

How to make cause validation false for Show Edit buttons in Gridview control

  
  HI. I am having 2 (dept name, City)dropdownlist, 1 Save button once if we click the save then record will be displayed in grid (Gridview with ShowEditbutton =true and I have Edit logic in my page). But if I click on Edit button then if I try to update the value then it is firing a message "Select dept" because dept dropdown present in the page so I want to make cause validation false for Show Edit buttons (update and cancel). Pleaase tell me Thanks

make a control required field using code in infopath

  

Hello guys,

How do i make a field required field using code. Specifically, how to make attachment control mandatory.

I know there is an option to select cannot be blank in properties but i want to do it conditionally.

Please help me.

 

 


Here is my new control code i couldnt make it so if i change the control size on form1 designer so i

  

I have two major problems.

1. After dragged the control to form1 designer when im on form1 designer i dont see anything in the control only when i run my program. I thought ill some kind of preview or what i painted in the control ill see it on the form1 designer before i run my application.

2. On form1 when i manualy stretch the size of the new control on form1 designer to be bigger or smaller the things i painted dosent fit i thought the way i created the code in the control code it will keep its size arroding to the size changed ill do in form1 designer but it dosent.

 

So here is the code of the control and form1 can someone help me with this two problems show me the correct code?

 

First the control code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DannyGeneral;

namespace My_Diet_Control
{
   
    public partial class My_Diet_Graph_Control : UserControl
    {
      
        int x_axis_lenght;
        int y_axis_lenght;
   &

Here is my new control code i couldnt make it so if i change the control size on form1 designer so i

  

I have two major problems.

1. After dragged the control to form1 designer when im on form1 designer i dont see anything in the control only when i run my program. I thought ill some kind of preview or what i painted in the control ill see it on the form1 designer before i run my application.

2. On form1 when i manualy stretch the size of the new control on form1 designer to be bigger or smaller the things i painted dosent fit i thought the way i created the code in the control code it will keep its size arroding to the size changed ill do in form1 designer but it dosent.

 

So here is the code of the control and form1 can someone help me with this two problems show me the correct code?

 

First the control code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;<


danieli

How to make my own AJAX Server Control

  

Hi,

The title says it all.

please give a very very clear tutorial preferebly video.

thnx



how to make login control allow users to login by either username or email address

  

how to make login control allow users to login by either username or email address 


DataGrid in a User Control. How to make it resizable in a form.

  

I embed the DataGridView control in a User Control.  The datagridview covers the entire user control.

When I used the user control in a form, I want to be able to size it the way I want to.  When I expand and shrink the user control, I want the embedded DataGridView to grow and shrink accordingly with the user control.  How would I go about doing that?

Without changing any of the default property values, when I place the user control on a form, the size stays fixed when used in a form.  That seems to happen only when you have a DataGridView in a user control.  

Thanks in advance.

Making your own controls - how to make them powerfully modifiable so anyone can use a control templa

  

If I look at a template for an expander, it always has to have a ContentPresenter in its control template and the control knows to use that for the content shown when the expander is expanded.  From there you can template out the control in all sorts of cool ways. 

A textbox's control templates need a scrollviewer with x:Name=PART_ContentHost for example.

The expander is fine with an unnamed control template, but the textbox requires a named scrollviewer.  I haven't messed around with putting multiple content presenters in an expander's control template and I currently have no idea what that would do.  This aspect of building my own controls is still quite foggy to me.  If I were to build a control, how do I determine if it looks for a named element in the control template (ala the textbox) or if it just finds a content presenter etc?

What if I wanted my new control to always contain several elements?

For example, with my current set of questions I am working on a resizable element.  I want that to always contain a draggable left and right boundary, as well as a togglable UI element for each of those boundaries that will toggle certain behaviors when I drag a specifc size and resize the control.  So ideally, I would want to define all of those things in a control template.  I would like it to

Extending a ListBox Control - How to make the extended type require the listbox items implement a ch

  

I am working on a drag and droppable timeline control, and I am making decent progress.  What I have so far will work decently enough with MVVM design patterns, but I am inexperienced with this kind of advanced control extending so I am sure that some of my methods are crude at best.

I have an extended content presenter control that I want to ensure is what is actually used inside my specialized listbox.  Right now I do the following:

<DataTemplate x:Key="TempTemplate" DataType="{x:Type local:TempDataType}">

			<tt:TimeLineItemControl StartTime="{Binding Path=StartTime}

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

  
In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Accessing the different controls inside a GridView control

  
how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

In-Depth look at the GridView Control

  
In the last article we looked at few of the new controls available in Asp.net 2.0. We also talked about Grid View Control which has replaced the Asp.net 1.1 DataGrid control for good. In this article we will examine more features of the Grid View control. In this article we will see some of the common operations that can be performed using the GridView control. Apart from these operations there are many more functions that can be performed on the control and which we will see in the later articles

ASP.NET repeater control - databind with style

  
even used the inline editing features, which I at the time thought was the coolest way possible to write ASP.NET code ( I managed to write code to hide all other rows and only show the current one - the row being edited). With a nice looking EditTemplate it looked indeed very slick but it really turned into giant and hard to manage code behind files.

Creating Paging for a Repeater Control

  
A common question is "How do I implement paging within a Repeater?" Although the beauty of the Repeater control is its flexibility, you're on your own for building most functions. ASP.NET 2.0 has included some new controls that provide paging, as does the DataGrid in ASP.NET 1.1. However, this tip shows you how to roll your own paging for a simple data viewer.

Using TemplateFields in the GridView Control

  
The GridView is composed of a set of fields that indicate what properties from the DataSource are to be included in the rendered output along with how the data will be displayed. The simplest field type is the BoundField, which displays a data value as text. Other field types display the data using alternate HTML elements. The CheckBoxField, for example, renders as a checkbox whose checked state depends on the value of a specified data field; the ImageField renders an image whose image source is based upon a specified data field. Hyperlinks and buttons whose state depends on an underlying data field value can be rendered using the HyperLinkField and ButtonField field types.
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