|
Modules are a backwards compatibility nightmare retained for VB6 users who don't want to learn OOP.
|
|
|
|
|
I like using a module for my sub main...but thats where it ends...
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Why not just move the Main code inside a class, such as a Form??
I don't use Modules for ANYTHING, even when I use a Main to get thing going...
|
|
|
|
|
just feels cleaner to separate it...a lot of times apps have conditional startup forms depending on the situation...maybe a first run wizard, etc...you can technically use a class instead of a mod, but a mod is easier and requires less code.
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
Polymorpher wrote: but a mod is easier
Only because it's in its own file.
Polymorpher wrote: requires less code.
No, it doesn't. It actually requires a little bit more. There is no difference between the code you put in a module and the code you put in a class.
|
|
|
|
|
The code in a class has to be shared, or static in C#...in a mod its just
Public Sub Main()
End Sub
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
I currently use IsUserAnAdmin() api function , MSDN :
Minimum DLL Version shell32.dll version 5.0 or later
Custom Implementation No
Header shlobj.h
Import library shell32.lib
Minimum operating systems Windows 2000
But many users reported this function doesn't exist in Windows 2000
How to tests whether the current user is an admin ?
Thank you
|
|
|
|
|
It does exist, it's just not exported by name.
According to the export list of Shell32.dll on Windows XP, IsUserAnAdmin is ordinal #680 (decimal). The oridnal number should not change between versions, so it should be the same in the Windows 2000 version.
So, in order to use it in Windows 2000, you have to specify the function's ordinal number instead of its name. If I remember correctly, its Declare looks like this:
Declare Function IsUserAnAdmin Lib "shell32.dll" Alias "#680" () As Boolean
|
|
|
|
|
|
Hi
I have a project where can change font color but cant't change when selected a line color always is in blue.. Can you help.
papoluca
|
|
|
|
|
Hi
I have a project where can change font color but cant't change when selected a line color always is in blue.. Can you help.
VISUAL BASIC 6 w SP6
papoluca
|
|
|
|
|
Hi
I have a LISTVIEW project where can change font color but cant't change when selected a line color always is in blue.. Can you help me.
VISUAL BASIC 6 w SP6
papoluca
|
|
|
|
|
Are you having fun talking to yourself??
There's a ton of examples on how to do this in VB.NET, but I can't find any VB6 examples to do this anymore.
Why are you using VB6 in the first place? It's not supported by Microsoft anymore. I, myself, haven't used it in over 6 years now...
|
|
|
|
|
any way to program so that visual basic 2005 express can calculate imaginary number
because i am trying to write a program which is to count the root of cubic
for example:
dim a as double
dim b as double
dim c as double
a = sqrt(b+c)
' how if the sum of b and C is not positive.. but i wan it to continue the the calculation
|
|
|
|
|
You could use a complex number type (class or struct) and teach it the basics.
There are several CP articles on this including this one[^].
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thankx
|
|
|
|
|
I did end up creating a program for my calculator that returned a string which contained the imaginary number as well as the correct formula formatting, but I had to hard code the logic behind creating an I (imaginary) and for what reason, etc.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
ncjlee wrote: any way to program so that visual basic 2005 express can calculate imaginary number
because i am trying to write a program which is to count the root of cubic
for example:
dim a as double
dim b as double
dim c as double
a = sqrt(b+c)
You could use the "SCI" library to do this. See bellow:
http://scinet.sourceforge.net/index.php/Home[^]
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
am using managed directX for a multimedia vb.net player
earlier on ma videos displayed correctly in their picturebox owners but right now they dont anymore, for about two weeks, dont know what to do,
anyway, i use a third party codec to play the avi and mpg videos and i use the directx runtime jun2007..
any help please?
phatkin
|
|
|
|
|
What does 'correctly' mean ? What changed on your PC ? Have you tried other videos, such as standard MPG files ? What does the code look like ? What on earth is 'ma', your mother ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
If you paint on a form using a color with alpha level of less then 255 the form background is partially visible. I was trying to achieve the same effect with controls.
I have a control derived from the control class. I have used this code:
SetStyle(ControlStyles.SupportsTransparentBackColor)
BackColor = Color.Transparent
and the foreground is painted with say: color.fromarg(50,255,0,0)
This works nicely with graphics that I have painted on the form background it is visible through the control. But other controls with a lower Z order should logically be visible through the control as well but they are not.
Any thoughts on how to get it to work?
thanks,
Gary
|
|
|
|
|
errorfunktion wrote: But other controls with a lower Z order should logically be visible through the control as well but they are not.
That's a good assumption IF transparent was actually "transparent". It's not. When you set the background of a control to Transparent, you're telling it to take on the background settings of it's parent container. It does NOT make the control transparent so you can see other controls behind it!!
|
|
|
|
|
Hi Dave, thanks for the fast response.
I still don't understand.
If the form has a gray background, on top of it is drawn a green circle.
On top of this is my control. If my control background is gray does that mean that the form in some way paints the green circle on my control?
If what you say is true that would be the only explanation, otherwise
I would not see the circle.
If this is the case can I employ this mechanism somehow to cause other
controls to behave in this manner?
|
|
|
|
|
from what I know of the subject is that when you use a paint (or graphics) to draw a circle onto the background of a form that circle 'becomes a part of the background' (don't really know how else to put it) but when you put a control on the form that control is not a part of the background therefor you can see the circle but not the control
other than taking a printscreen and putting that printscreen cropped on the background of you upper control I wouldn't know how to do it (and I probably would give up the print screen methode since it will be very buggy and maybe even impossible (but I'v never try'd anything like this))
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
This is simply not true. There is one computer screen and hence only
one set of pixels. If the form background is gray and one draws a green circle those pixels become green. The Form Background is still gray. If a control on top of the form obscures the circle and then moved the form paint event repaints the circle. The circle is by no means part of the background.
Also Dave, It's not true that color.transparent simply gives the control the
container background. If I manually give the control the same background as the
form the circle is not visible. Meaning that color.transparent clearly does
something more.
What it does I don't know.
|
|
|
|