473,800 Members | 3,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# / VB.NET inline namespaces, how can I do: New System.Windows. Forms.MessageBo x?

Hi, if someone could answer this please I would be grateful - I have
looked online but can't find the answer.

In C# I can do this for example

m = new System.Windows. Forms.Form()

but of course in VB.NET the same would be wrong

m = New System.Windows. Forms.Form()

because of the default namespace, I'd really be saying

m = New DefaultNamespac e.System.Window s.Forms.Form()

okay, fair enough, so how do I get out of the default namespace (or
can I even)?

eg. something like
m = New Global.System.W indows.Forms.Fo rm()

Sure I can do

Imports System.Windows. Forms
.....
m = New Form

but sometimes I'm too falsely lazy to hit home, type it in and then
ctrl -
Thanks
Jim
Jan 16 '08 #1
3 1650
jd*******@gmail .com wrote in news:e3d5a2bc-a1fd-4095-b417-
2d**********@n2 2g2000prh.googl egroups.com:
but of course in VB.NET the same would be wrong

m = New System.Windows. Forms.Form()

because of the default namespace, I'd really be saying
Try:

Dim m = New System.Windows. Forms.Form()

--
sp**********@ro gers.com (Do not e-mail)
Jan 16 '08 #2
Ah, yeah playing now I see. Ok, so my question was wrong. My real
problem was I was already in a similar namespace

eg.

Namespace X.Y

within which you can't do

Public Shared b As X.C

can in C# but not in VB - don't know why, will just live with it.

Sorry for not checking what I was asking after I reduced it...

Jim

On Jan 16, 11:38*am, Spam Catcher <spamhoney...@r ogers.comwrote:
jdlwri...@gmail .com wrote in news:e3d5a2bc-a1fd-4095-b417-
2d7906bfa...@n2 2g2000prh.googl egroups.com:
but of course in VB.NET the same would be wrong
m = New System.Windows. Forms.Form()
because of the default namespace, I'd really be saying

Try:

Dim m = New System.Windows. Forms.Form()

--
spamhoney...@ro gers.com (Do not e-mail)
Jan 16 '08 #3
Jim,

Don't fool up here what you cannot do in VB however in C#.

Most VB programmers have a better knowledge about C# than visa versa.

Cor
Jan 17 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3803
by: Greg Bacchus | last post by:
Hi, I'm getting an exception that really has me stumped. It's sporadic at best, it's only happened a handful of times. This particular time it happened when the user pressed 'Alt-S' to save the data that they were entering. Following is all exception information. Any thoughts much appreciated. Cheers
4
332
by: Bernard Bourée | last post by:
Hello When I try to import the System.Windows.Forms.MessageBox I get a meesage saying that it is not avalaible ? How to solve it ? Thanks Bernard
7
1439
by: Aniket Sule | last post by:
Hi, I am trying to use a class from one namespace in another via the using directive. The 2 namespaces have some part of the name in common (A.B.x, A.B.y). However in the second namespace, I am unable to access the class from the first without qualifying it, which is what i want to avoid. Any ideas what I am doing wrong? I am attaching the code and compiler error below to show exactly what I am trying to do,
17
2078
by: clintonG | last post by:
Using 2.0 with Master Pages and a GlobalBaseClass for the content pages. I understand the easy part -- the hierarchical structure of a namespace naming convention -- but the 2.0 IDE does not write a signature for the developer and after getting a good start developing a 2.0 application I thought I should go through the code and start marking classes and with namespaces. I keep getting the following 'missing' error even when using a first...
5
1605
by: Davíð Þórisson | last post by:
I've never understood fully, why do I have to td eg: using system; using system.data; I would have thought that the top line imports system and all of its submembers, including data??
7
1344
by: Dylan Parry | last post by:
Hi, I've started to get a bit confused by namespaces and hierarchical organisation in general. What I want to do is something like this: Namespace MyNamespace | |- Class Foo | |- Namespace MyNamespace.Foo
6
2474
by: douglass_davis | last post by:
Is the whole System namespace automatically imported?
3
4035
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user selects? thanks...
2
4502
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message boxes (please see associated source code below): 1) Win32 API with context ("btnWin32WithContext_Click") 2) .NET Framework with context ("btnFrameworkWithContext_Click") 3) Win32 API withOUT context ("btnWin32WithOUTContext_Click")
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.