Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday, 28 February 2016

HOW TO USE SYSTEM.DRAWING NAMESPACE IN ASP.NET C#


Today in Engineer's World, we are discussing ASP.NET & C# query faced by a developer in very easy way. Posted By- +Manish Kumar Gautam +LIVE VIAR +ASP.NET SOLUTIONS 

Click imagination hunt to see latest Blogs

Previous - TOP 15 VISUAL STUDIO SHORTCUT KEYS - Part III

How to use System.Drawing namespace in Asp.net C#

In this, article we will learn how to use System.Drawing namespace?

There are two ways of using namespace in your project:
(1) Writing the namespace to the top of the web form
(2) Writing namespace to the inline

Note: Color class is present in the System.Drawing Namespace

Practical Implementation:

Design Code(Default.aspx)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="lblMsg" runat="server"
        Text="LIVEVIAR- Education For All"></asp:Label>
    </div>
    </form>
</body>
</html>

Choice-1: Writing the namespace to the top of the web form

Practical Implementation:

Server-Side Code (Default.aspx.cs)

using System;
using System.Drawing;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        lblMsg.ForeColor = Color.MediumTurquoise;
    }
}

OUTPUT:



Choice-2:  Or we can write the complete namespace in the inline code

Practical Implementation:

Server-Side Code (Default.aspx.cs)

using System;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        lblMsg.ForeColor = System.Drawing.Color.MediumTurquoise;
    }
}

OUTPUT:




For any query, comment us below.


Related Questions:


Q-1 Which namespace declaration choice is good to use and when?
Ans. We knows both are providing the same result. But, when to use it is really very important.
If you want to use the Drawing Namespace functionality multiple times, then declare the namespace at the top. Otherwise, declare it inline code.

Q-2 What is the use of drawing namespace?
Ans. System.Drawing namespace provides us Graphics Display operations and functionality. It contains various Classes include font, image, bitmap, etc., Structures include color, rectangle, size, etc., Enumerations and Delegates.

Click imagination hunt to see latest Blogs

Keep learning and sharing…
Read More »

Thursday, 25 February 2016

TOP 15 VISUAL STUDIO SHORTCUT KEYS

Today in Engineer's World, we are discussing ASP.NET & C# query faced by a developer in very easy way. Posted By- +Manish Kumar Gautam +LIVE VIAR +ASP.NET SOLUTIONS 

Click imagination hunt to see latest Blogs

Previous - TOP 15 VISUAL STUDIO SHORTCUT KEYS - Part II

Top 15 Visual Studio shortcut keys

11. CTRL + TAB (TO MOVE WITHIN SEVERAL WINDOWS OR FORMS): This shortcut makes you easily move from one tab to another. You only need to have opened several documents.
 
Tab Movement

12. F4 (VIEW PROPERTY WINDOW): This shortcut key is used to open the property window.
 
Property Window

13. CTRL + ALT + L (VIEW SOLUTION EXPLORER): This shortcut key is used to open the solution explorer window.
 
Solution Explorer Window

14. CTRL + A, CTRL + S, CTRL + Z, CTRL + Y, CTRL + X, CTRL + C, CTRL + V (COVER ALL SELECTION, TO SAVE, UNDO, REDO, TO CUT, TO COPY, TO PASTE): All these shortcut keys are most commonly used keys.

15. CTRL + MOUSE SCROLL UP, CTRL + MOUSE SCROLL DOWN (TO EXPAND AND COLLAPSE): This shortcut is used to zoom in and out of the screen. This key is very useful when you are working with the projector.
 
Zoom In / Out


For any query, comment us below.


Related Questions: -


Q-1 What is debugging? What is debug mode?
Ans. Debugging means locating, fixing and bypassing bugs from the computer program. Debug mode is - applying breakpoint in your code, and then go through each line one at a time. This makes your project build step by step.

Q-2 By which shortcut we can move from one opening tab to another in VS?
A) CTRL + TAB
B) CTRL + ALT + T
C) CTRL + SHIFT + T
D) CTRL + ALT + TAB
Ans. Option(A).
Explanation: See Point no 11 of this blog series.

Click imagination hunt to see latest blogs

Keep learning and sharing…
Read More »

Featured post

Think that makes you rich and richer

 Napolean said: “You can think and grow rich, but if you can be brought up like most people with work and you won't starve, this wil...