Click here to Skip to main content
15,914,905 members
Home / Discussions / Windows Forms
   

Windows Forms

 
QuestionTransparent control in Visual Basic 2008!!! Pin
Аslam Iqbal6-Apr-10 9:47
professionalАslam Iqbal6-Apr-10 9:47 
AnswerRe: Transparent control in Visual Basic 2008!!! Pin
Dave Kreskowiak6-Apr-10 9:59
mveDave Kreskowiak6-Apr-10 9:59 
GeneralRe: Transparent control in Visual Basic 2008!!! Pin
Аslam Iqbal6-Apr-10 10:39
professionalАslam Iqbal6-Apr-10 10:39 
AnswerRe: Transparent control in Visual Basic 2008!!! Pin
Anshul R8-Jun-10 20:13
Anshul R8-Jun-10 20:13 
QuestionInterface Pin
Ahamed Azeem1-Apr-10 2:12
Ahamed Azeem1-Apr-10 2:12 
AnswerRe: Interface Pin
Eddy Vluggen1-Apr-10 2:26
professionalEddy Vluggen1-Apr-10 2:26 
GeneralRe: Interface Pin
Ahamed Azeem1-Apr-10 2:33
Ahamed Azeem1-Apr-10 2:33 
GeneralRe: Interface Pin
Eddy Vluggen1-Apr-10 3:33
professionalEddy Vluggen1-Apr-10 3:33 
Ahamed Azeem wrote:
Why do we want to go for interfaces rather than normal method definition.

Mostly to prevent thight coupling, but there may be other reasons. An interface just says how the "normal method definition" should look, it doesn't contain any implementation; that means that if a class implements an interface that you can be sure that this class has all the properties and methods that are defined within the interface.

A variable of the type IDbConnection can hold a SqlConnection or a OracleClientConnection. You could only talk to Sql Express if you used a SqlConnection variable.

There's a better explanation of that idea over here[^].

Ahamed Azeem wrote:
Your second answer is not clear to me. Could you pls explain more

The first alternative usage is a namespace alias[^]. That would allow you to "rename" the namespace. This is common in Office-development to shorten the namespaces. As an example;
C#
static class SomeClass 
{
  static void someMethod () 
  {
    System.Diagnostics.Debug.WriteLine("bla");
  }
}
With a namespace-alias, it would look like this;
C#
using Diag = System.Diagnostics;
static class SomeClass 
{
  static void someMethod () 
  {
   Diag.Debug.WriteLine("bla");
  }
}

The second alternative[^] use is what the "interviewer" wanted to hear, and looks like this;
C#
using (Font font1 = new Font("Arial", 10.0f)) 
{
    byte charset = font1.GdiCharSet;
}
This ensures that IDisposable is called cleaning up the Font.
Happy Reading Smile | :)

GeneralRe: Interface Pin
Ahamed Azeem1-Apr-10 6:22
Ahamed Azeem1-Apr-10 6:22 
AnswerRe: Interface Pin
dan!sh 1-Apr-10 3:45
professional dan!sh 1-Apr-10 3:45 
AnswerRe: Interface Pin
Luc Pattyn1-Apr-10 3:47
sitebuilderLuc Pattyn1-Apr-10 3:47 
GeneralRe: Interface Pin
Eddy Vluggen1-Apr-10 5:48
professionalEddy Vluggen1-Apr-10 5:48 
GeneralRe: Interface Pin
Ahamed Azeem1-Apr-10 6:20
Ahamed Azeem1-Apr-10 6:20 
GeneralRe: Interface Pin
Dave Kreskowiak5-Apr-10 3:27
mveDave Kreskowiak5-Apr-10 3:27 
GeneralRe: Interface Pin
Ahamed Azeem5-Apr-10 4:22
Ahamed Azeem5-Apr-10 4:22 
AnswerRe: Interface Pin
Abhinav S1-Apr-10 6:15
Abhinav S1-Apr-10 6:15 
Questionhow to create MDI form in c#.net with menus Pin
developerit21-Mar-10 0:24
developerit21-Mar-10 0:24 
AnswerRe: how to create MDI form in c#.net with menus Pin
Abhinav S21-Mar-10 1:01
Abhinav S21-Mar-10 1:01 
QuestionWhich tools is better to design the UI (user interface)? Pin
yu-jian17-Mar-10 16:32
yu-jian17-Mar-10 16:32 
AnswerRe: Which tools is better to design the UI (user interface)? Pin
Eddy Vluggen18-Mar-10 2:48
professionalEddy Vluggen18-Mar-10 2:48 
AnswerRe: Which tools is better to design the UI (user interface)? Pin
dybs28-Mar-10 18:31
dybs28-Mar-10 18:31 
QuestionDrag and move a button anywhere on the form Pin
phani2548517-Mar-10 14:49
phani2548517-Mar-10 14:49 
AnswerRe: Drag and move a button anywhere on the form Pin
yu-jian17-Mar-10 17:55
yu-jian17-Mar-10 17:55 
GeneralRe: Drag and move a button anywhere on the form Pin
Som Shekhar17-Mar-10 20:51
Som Shekhar17-Mar-10 20:51 
GeneralRe: Drag and move a button anywhere on the form Pin
phani2548517-Mar-10 22:38
phani2548517-Mar-10 22:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.