S
H
A
R
E
Showing posts with label CSharp. Show all posts
Showing posts with label CSharp. Show all posts

Saturday, June 09, 2012

CSharp ExecuteNonQuery Sample

protected void btnSignIn_Click(object sender, EventArgs e)
    {
        string strConnection = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        string strInsert = "INSERT INTO Users (Username,Password) VALUES(@Username,@Password)";
        SqlConnection con = new SqlConnection(strConnection);
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = con;
        cmd.CommandType = CommandType.Text;
        cmd.CommandText = strInsert;

        SqlParameter username = new SqlParameter("@Username", SqlDbType.VarChar, 50);
        username.Value = txtUserName.Text.Trim().ToString();
        cmd.Parameters.Add(username);

        SqlParameter password = new SqlParameter("@Password", SqlDbType.VarChar, 50);
        password.Value = txtPassword.Text.Trim().ToString();
        cmd.Parameters.Add(password);

Read More!

Thursday, June 07, 2012

CSharp Create PrintPreview Dialog


this post will explaining how to use printpreviewdialog with C# to preview before printing datagridview in windows forms application.

Read More!

Thursday, April 19, 2012

haarcascade porn and breast detection

I have two haarcascade for nude image detection, first is for breast detection, and for porn (nude) image detection.
Haarcascade for porn image detection, accuarate just 40%-50%, still have many false detection, but you can use for detecting a nude image. created by Indonesian people.
And haarcascade for breast detection, it have 70%-80% accuration. i don't know who made it, but i got it from Hackchina source code search engine.
now you can make your OpenCV to detecting a nude image by using this haarcascades. but you need for create a skin color detection algorithm for make detection more accurate! i will share for skin color detection algorithm in the next moment.

Read More!

Tuesday, August 02, 2011

Custom Form Appearance With Standard Behaviour

There are several ways to Custom Paint a form, but each has their flaw.
This method starts with a standard Form that has its BorderStyle set to None.

Read More!

Sunday, July 31, 2011

Shaped Form Resizable and Moveable

Shaped Form Resizable and Moveable
This is by no means a complete solution, just an idea for creating custom shaped forms with custom Titlebars.
The form can be dragged by its fake titlebar, and if right clicked the fake Titlebar will popup the WindowMenu.
The CreateParams property has been modified to add a System Menu (with Min,Move and Close items) to a borderless form.

Read More!

Wednesday, July 27, 2011

Create Slider Control With Custom Color

All too often I see examples of custom controls which unnecessarily add child controls. For instance, a custom trackbar control may have a label or panel added to act as the scrolling thumb tab.

Read More!

Create a Circle Rounded Panel Controls

rounded panel Form Controls VB net CSharp
When we Draw to a Graphics object we can set AntiAlias so as to make the edges of complex shapes look smooth. This is done by altering the color of some of the pixels on and around the edge so that the jagged edges appear smooth.

Read More!

Monday, July 25, 2011

Create Combobox With Icon

Create Combobox With Icon
The following class modifies the Item collection to return a collection of Custom items. The Property Browser uses the Collection Editor rather than the StringCollection Editor. The DrawMode property has been hidden, since this property should not be changed.

Read More!

Create Custom Button in Form

Create Custom Button in Form VB net Csharp
No need to Inherit from Button if you want a button with a completely custom appearance.

Read More!

Saturday, July 23, 2011

Custom Tab Control With Cool Appearance



Read More!

Custom Menu Design With MenuSkinner

Custom Menu Design With MenuSkinner
Drop a MenuSkin component on your form and standard menu items are extended with icon and font properties.

Read More!

Friday, July 22, 2011

Create Menu Bar Like Office style Menu

Create Menu Bar Like Office style Menu
A complete ownerdraw menu class with RightToLeft support.

Read More!

Add Menu Items on Top Left Window Icon (AKA System Menu)

Add Menu Items on Top Left Window Icon
There is no DotNet Native way to manipulate the Window Menu. You must do it all via InterOp.
You can add existing Menuitems though.

Read More!

TabDragging Example using TabDragger Class

Add the following classes to your project and make one of the following calls to your forms constructor after the InitializeComponent() call (assumes your TabControl is named TabControl1):
This will give you simple DragArrange of the tabs.
[VB] Dim DragTabs As new TabDragger(TabControl1)
[C#] TabDragger DragTabs = New TabDragger(this.tabControl1);

Read More!

Show Hide Tabpages in Tabcontrol


The Visible property has not been implemented on the Tabcontrol and there is no Insert method. The following methods are a workaround.
This some sample by: Mick Doherty. demonstrated how to manipulate show and hide tabpages in a tabcontrol. See this code, sample in VB net and Csharp

Read More!

Thursday, July 21, 2011

Create Custom Design for A Tab Control


Custom  Design for A Tab Control

A little more work involved here than in the previous case, but definately worth it. Add a new UserControl to your project and replace the code with that shown below.

Read More!

Tab control using custom Tabpages



Vb net Csharp Tabcontrol Custom Tabpages

This was one of the first projects I tackled in dotnet. The object was to have the tabpages support WindowsXP Visual Style. Adding visual style to an inherited TabPage was simple and after a few attempts I got the TabControl to accept the custom Tabpages via the Collection Editor.

Read More!

Sunday, May 29, 2011

Saturday, May 28, 2011

Thursday, May 26, 2011

CSharp Form With Aero Glass


Simple Form With Aero Glass Effect


Read More!