|
This seems to work:
Dim sheet As Excel.Worksheet = xl.Worksheets.Item("Sheet2")
sheet.Activate()
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.
|
|
|
|
|
If you could, would you look at my post:
VB.NET Excell Cell Formatting
I am 1 week from graduating and my senior project is due.
I am having a problem with 1) excel's handling of text, 2) excels non-column autosizing
I would appreciate any insight you may be able to provide.
Regards,
Erik J. Long
|
|
|
|
|
Hi,
I am developing a Windows.Forms app. I am using a multi tier architecture with databinded strongly typed datasets . I am using a data access component called Facade where I have a method:
public Sub LoadCompany(ByVal companyID as Integer, ByRef ds as CompaniesDataSet)
ds.Clear()
...code to set the parameter in the select command
DACompanies.Fill(ds)
End Sub
It seems that ds.Clear() takes more and more time to complete , from a few miliseconds at start to 4-5 seconds after 100 method invokes.
Anyone has an answer to this?
Thank you,
Dan Bunea
|
|
|
|
|
hi,,
How to automatically install Mdac along with my software ? I have downloaded mergemodules for mdac,but it doesnt work, i.e. its not getting automatically installed... how to do it? When I attach Mdac.msm merge module in my setup project and see the no. of files, it shows (none), i.e. the list is empty..
thanks
het
Be Humble in Victory and Strong in Defeat. -Het
|
|
|
|
|
In Visual Basic 6 you could add descriptive text to your object procedures by using the “Procedure Attributes” dialog. Descriptive text would then appear in the Object Browser.
How can I add descriptive text to my object procedures (methods) in VB.Net and have it appear in the Object Browser and in the Intellisense Pop-Ups. (Like different text for overridden methods.) I suspect this is done using attributes but 4 ½ hours in the MSDN has only served to confuse the issue even further. If possible, please include some source code showing how it is done. Thanks to anyone that can provide a solution to this problem.
|
|
|
|
|
The VB compiler natively supports adding descriptions using the Description attribute. These will appear in the Object Browser and below the Properties box in the bottom right corner of the IDE, but will NOT show up in Intellisense. For this, you have to use a plug-in like VBCommenter. You can find that here[^].
An example of the Description attribute:
<Category("Appearance"), _
Description("Set the number of LEDs to display."), _
DefaultValue(4), _
Bindable(True)> _
Public Property SizeInBits() As Integer
Get
Return m_SizeInBits
End Get
Set(ByVal NewValue As Integer)
If NewValue < 1 Or NewValue > 32 Then
Throw New ArgumentOutOfRangeException("SizeInBits", "Value must be between 1 and 32.")
Else
m_SizeInBits = NewValue
OnSizeInBitsChanged(EventArgs.Empty)
If m_Value >= (2 ^ m_SizeInBits) Then
m_Value = 0
OnValueChanged(EventArgs.Empty)
End If
End If
End Set
End Property
RageInTheMachine9532
|
|
|
|
|
Every time that I make a new project it has an error it says sub main not found. can someone help me figure this out cause it's really torqin' me off. Any suggestions or an answer to my problems would be much appreciated!
Sam
|
|
|
|
|
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?".
|
|
|
|
|