|
Is the problem that you have a Sub Main and you're still getting the message or that you want to know why you need a Sub Main?
Charlie
if(!curlies){ return; }
|
|
|
|
|
In a new VB.NET Windows Form project, if you remove the original Form1.vb and create a new form or main module, when you compile that project, it will tell you something like "Sub Main was not found in ProjectName.NewForm". Right-click on the project, click properties, then Common Properties, General, Startup Object, choose which thing will be your entry point for the application. In VB.NET, this will either be a Sub Main of a module or class, or a Form.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
The problem comes in because you either removed the Form1 object, deleted the file like you said in your previous post, or you renamed Form1 improperly. When you did this, the Startup Object automatically reverted to Sub Main, even if you don't have one, since you don't have a valid startup form any more. Then when you created a new form, the Startup Object stayed as Sub Main and won't revert back to a valid form automatically.
RageInTheMachine9532
|
|
|
|
|
Dave,
Did you mean to reply to the original poster? I thought my post read like an explanation...
JAK
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Sorry! It was meant for the original poster!
RageInTheMachine9532
|
|
|
|
|
Why not change the startup module in your project properties?
grtz,
Guus
|
|
|
|
|
I have two monitors on two separate video cards and would like to display a form on the second monitor automatically when launched.
I have form A launching on the first screen and form b launching at the same time. I want form B to go to the second screen.
Any help greatly appreciated!!
Thanks,
Bob
|
|
|
|
|
The upper left corner of the screen on the primary monitor is 0, 0. So, assuming both monitors are the same size (1280 by 1024, let's say), the upper left corner of the screen on a secondary monitor placed to the left of the primary would be -1280, 0. If the secondary is to the right of the primary, the upper left corner would be 1281, 0. If it's above it's 0, -1024 and so forth and so on...
frm2.StartPosition = FormStartPostition.Manual;
frm2.Location = new Point(-900, 200);
Charlie
if(!curlies){ return; }
|
|
|
|
|
In multimonitor environments use the DesktopLocation property instead of the Location property to correctly position forms.
|
|
|
|
|
hey guys i need xp style in my vb application. If you know of any free libraries available please reply.
Thanks a lot
|
|
|
|
|
VB.NET: System.Windows.Forms.Application.EnableVisualStyles()
VB6:
Add the API function InitCommonControls, defined as: void InitCommonControls(VOID);
In VB: Private Declare Sub InitCommonControls Lib "comctl32.dll" ()
Make sure you make a call to this in Form_Initialize:
Private Sub Form_Initialize()
InitCommonControls
End Sub
Then add a manifest file called <appexename>.manifest, so if your app is App1.exe then this file would be App1.exe.manifest. The file must contain the following lines:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Your App name goes here"
type="win32"
/>
<description>Your App name goes here</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
greetz
*Niels Penneman*
<hr><a href="http://users.pandora.be/un1c0rn/software/">Software/Dev Site</a><br><a href="http://users.pandora.be/un1c0rn/">Personal Site</a><hr>
|
|
|
|
|
How do you make a small program which allows you to see passwords??
So, if you see an password in a textbox, whith ****, how can you encrypt this??
|
|
|
|
|
Encrypt? Do you mean you want to scramble the actual text behind the dots, or you want to see the text behind the dots?
If you want to see the text, you would use GetWindowText or use SendMessage and the WM_GETTEXT message to retrieve the text from the Textbox. BUT! I'm NOT telling you how to get the window handle of the Textbox! Hacking a password is not supported here...
If you want to encrypt the text, you can't. If you encrypt the text, your actually just typing the scrambled characters into the textbox and the program will not know that your password is scrambled and pass on a scrambled (and incorrect) password to whatever authentication process is being used.
To stop this practice from being used on projects I've worked on in the past, I've used techniques like clearing the password from the textbox after 3 seconds or so and have written a textbox control that keeps the password typed in seperate from the textbox. The textbox display is just a plain textbox, without using the Password Character property, that just has asterisks in it that correspond to the number of characters entered. You can use Revelation on it, or some other hack tool that does the same, and you'll actually see a string a asterisks instead of the text behind them.
And no, I can't give you the code for it because it's copyrighted by my employer at the time...
RageInTheMachine9532
|
|
|
|
|
Hiya all. I'm planning on making a program for a card game I have (Munchkin, if you wanna know). In creating this program, I was hoping to declare a Player type variable, if it's possible, and create my own properties like Level, Gender, and so on. Unfortunately, I have been unable to find a way to do this. If anyone can help me, or can think of another way to accomplish my goal (XML files might work, I dunno), I'd appreciate it.
Thanks in advance.
EDIT: In case my post wasn't clear enough, I want something like this:
Dim plrMike as Player<br />
...<br />
plrMike.Level = 1<br />
plrMike.Gender = Male
Signed, Mecha-Poobah of The Love Which Dare Not Speaketh Its Name, Codemonkey Jackson
Title Generator - http://title.flywheel.org/
|
|
|
|
|
One of two things you could do:
1) Create a Class:
Assuming VB.NET: You will create a new class library named Player.vb.
Assuming VB6: You will create a new class library named Player.cls.
2) Create a type/structure:
Assuming VB.NET: Create a structure definition using Structure...End Structure.
Assuming VB6: Create a type using Type ... End Type
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
Well, I went ahead and made a new class library (my new variable type ends up being Munchkin.Player.Character). I can do things now like assign "Male" to Character.Gender, but I can also do wacky things like Character.Gender = "Chicken". Another thing is that the maximum level is supposed to be ten, but I could make Character.Level whatever integer I want, even negatives. What do I do to limit what kinds of genders there are, or specify which ones do and don't work?
As I sit here, I contemplate the last words of Socrates: "I drank what?".
|
|
|
|
|
Well, you could do a couple of things. You could have an Enum in your project, like:
Namespace Munchkin
Public Enum Genders
Male
Female
End Enum
End Namespace
Then, you could declare your Gender field like:
Public Gender As Genders
And the only valid thing to put in it would be:
someCharacter.Gender = Genders.Male
You could do the same thing with levels, or you could throw an exception if a character's level is set below 1 or above 10:
Public Class Character
Private _level As Integer
Public Property Level() As Integer
Get
Return _level
End Get
Set(ByVal Value As Integer)
If Value < 1 Or Value > 10 Then
Throw New ApplicationException("Level must be between 1 and 10")
Else
_level = Value
End If
End Set
End Property
End Class
But guess what? Your Character is starting to sound more like a class than a structure...
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
>But guess what? Your Character is starting to sound more like a class than a structure...
In that case, I must have misinterpreted your orginal advice; I had a project named Munchkin, a Class named Player, and a Structure named Character. It looked something like this:
Structure Character<br />
Public Name As String<br />
Public Gender As String<br />
Public Level As Integer<br />
End Structure
But I guess I should do the Class thing and the Structure thing seperately. Anyway, thanks for the help. I'm gonna try the Enum and Exception code now.
As I sit here, I contemplate the last words of Socrates: "I drank what?".
|
|
|
|
|
Although, on the other hand, you could produce a Class that acts like a Character factory. Anyway, glad I could lend a hand.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
I am working on some VB Script and am using an InputBox that accepts a password. When the user types in the password, I would like it to show up as *********
Any help doing this would be great. Here is some of the code:
strUserIn = InputBox("Enter Password")
if strUserIn <> "" then
Set fs = CreateObject("Scripting.FileSystemObject")
strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "~userp.txt")
strFileName = fs.GetAbsolutePathName(strFileName)
Set ts = fs.OpenTextFile(strFileName, 2, True)
ts.WriteLine strUserIn
ts.Close
end if
|
|
|
|
|
VBScript and the Windows Script Host don't yet support a password-type input box yet. You'll have to use an external component of some kind to do this or make your code run in an HTML page and use an HTML password box. But, there are limitation on what your script can do inside a browser.
RageInTheMachine9532
|
|
|
|
|
High timer experts,
I have a problem very similar to the "Help clock generate" thread.
I want to control a stepper motor of an electrophoresis unit.
The Motor should be driven with (only) 250 hz.
The low precicion timers using the message que (windows.froms.timers)
are not usefull for this purpose (Instantly I wandered why the motor
does not perform all steps with the timer set to 50 Hz, but meassuring the
intervals using the system performancecounter revealed, that about every
10th interval is only 203 ticks long -- for what ever reason)
Looking for a solution, I came accross -Queue timers- which should be able to
deal with this problem. Unfortunately, I am not familiar with C programming language
and all the examples were written in C (e.g. here).
Is there a possibility to run such a timer from VB.net?
Thanks in advance
Armin
|
|
|
|
|
If my math is right, at 250Hz, you need to fire the event every 4 milliseconds. The timers that your finding all have 1 millisecond resolution. At that low an interval, the millisecond timers are not really that accurate. They can be off by as much as a millisecond when your app receives the notification.
I think that part of the problem is the priority that your process is running under. You might want to consider running your app and then, before you start the timer test, go into the Task Manager, click on the Processes tab, right-click on your app and bump the priority up to High or RealTime to see if the interval stabilizes for you.
RageInTheMachine9532
|
|
|
|
|
Hi All
I have started writing a program to get the crc32 of a file. I have this working fairly well. The only thing now is I need to get the crc32 of a complete folder and its contents and get an overall checksum for it, but I don't seem to be able to get it to work. If anyone can give some insight to this problem it would be great. Also I cannot get to display the file size of the file i am checking.
Thanks
|
|
|
|
|
You might want to show the code your using to get a CRC on a directory and its contents.
Are you looking to get the CRC on all the filenames? Or are you trying to get a combined CRC of all the files in the directory?
RageInTheMachine9532
|
|
|
|
|