|
Hello,
I have a menu that a user can click and open a window. However, if the user was to click this form many time, it will continue to open up more windows. I want to prevent this from happening. If the user clicks open, it should just open the window once, if the window is already open, then it should get focus for that window.
I hope you understand, this is my code so far.
<br />
Dim rep10 As New NewCalls<br />
rep10.MdiParent = Me<br />
rep10.Show()<br />
Thanks in advance,
steve
|
|
|
|
|
http://www.codeproject.com/vb/net/Simple_Singleton_Forms.asp
|
|
|
|
|
Currently i doing a project on scheduler. My task is to perform a remote shutdown on the computers in my network at a specified time. I have problem figuring the code for this function. Can anyone help? Thanks a lot.
|
|
|
|
|
I am in the process of deploying a project using Visual Studio's Windows Installer but would like to check software activation keys before doing the install. I've looked at custom actions but they are executed after the installation. Is there a way to to this ?
Regards
"The things that will destroy us are: politics without principle; pleasure without conscience; wealth without work; knowledge without character; business without morality; science without humanity; and worship without sacrifice."
-Mahatma Gandhi (1869-1948)
|
|
|
|
|
You'll want to look at the Launch Conditions editor. This is where you can add requirements before an install.
|
|
|
|
|
I had a high school course in Visual Basic 6.0. However, I am now in college studying c++ in a unix-based environment. I am tryin to get back in to VB using VB.NET 2005. I am a gymnastics coach and i am trying to create a program that stores the skills each child has accomplished and retrieve them.
Any ideas as to how I can get the data to open and save?
|
|
|
|
|
j5matt wrote: ny ideas as to how I can get the data to open and save?
To be honest, VB2005 is so different to VB6, you really may find it easier to use C#, based on your knowledge of C++ style syntax ( although C# is nothing like C++ ).
Your best bet is probably an access database, only because it's more portable than a SQL Server one. Either way, there are tons of tutorials around on how to do this. Access also allows you to easily create your tables without writing any SQL.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Who gave you a 2 and why? That's what I want to know. Anyway, I've countered it because I can't see anything basically wrong with your answer.
|
|
|
|
|
I didn't even notice. What I find funny is, it was a 2, but not quite a 1 ? How do people quantify that ? If it's not 1 or 5 I don't bother voting.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'm in the process of converting an application written in VB from VS2003 to VS2005, which has numerous random access files and structures. I am receiving warnings that read "Implicit conversion from 'System.ValueType' to StructureName in copying the value of 'ByRef' parameter 'Value' back to the matching argument. The application does function as designed, but I would like to correct the code to remove these warnings.
I have been searching the internet for weeks and have found many folks with the same problems, but no solutions have been posted. A sample of the associated code is listed below. With the statement
"FileGet(intCarFileNum, MyCellCarriers, intL)", the structure "MyCellCarriers" is underlined in green.
Any suggestions would be greatly appreciated.
Public Structure struCellCarriers
<vbfixedstring(3)> Public cIndex As String
<vbfixedstring(1)> Public cSep1 As String
<vbfixedstring(48)> Public cCarrier As String
<vbfixedstring(1)> Public cSep2 As String
<vbfixedstring(1)> Public cCR As String
End Structure
Public MyCellCarriers As struCellCarriers
intCarFileNum = FreeFile()
FileOpen(intCarFileNum, strCarFile, OpenMode.Random, , OpenShare.Shared, Len(MyCellCarriers))
intCarRecCnt = LOF(intCarFileNum) / Len(MyCellCarriers)
cboCellCarrier.BeginUpdate()
cboCellCarrier.Items.Clear()
For intL = 1 To intCarRecCnt
FileGet(intCarFileNum, MyCellCarriers, intL)
With MyCellCarriers
If .cCarrier.Trim > "" Then
cboCellCarrier.Items.Add(.cCarrier.Trim)
End If
End With
Next intL
FileClose(intCarFileNum)
|
|
|
|
|
how to add a msfgrid in VB.Net.
|
|
|
|
|
where are you struggling?
|
|
|
|
|
hi,
i didn't find msfgrid in components.
|
|
|
|
|
it comes with vb6 so if you have that, install it then you will have it available to you. otherwise...
|
|
|
|
|
ActiveDocument gives error whenever i open any existing document..
CType(applicationObject, Word.Application).CustomizationContext = CType(applicationObject, Word.Application).ActiveDocument
CType(applicationObject, Word.Application).ActiveDocument.Saved = True
oh !! i missed out the important part..
well this works fine when i go:- start-> run-> winword
it works fine when i go with debuging..
but if i run existing document by double clicking... it gives error .. specifying activeDocument not exist..
-- modified at 2:24 Thursday 19th October, 2006
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Where are you calling the function?
If you have opened a document prior to calling ActiveDocument it should work.
If there's no documents opened at all by Word it will return the error you mentioned.
And why do you keep boxing the applicationObject several times? You should cast it into a Word Application object and use it as it's more efficient this way.
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
huh !! finally some one repled !!
OK now first boxing.. i'll do follow ur suggesion...
i'm calling this function from OnStartupComplete..
well i;ve tried an another way, used WindowActivate event of word object to add commandbar .. well it does work in case of opening existing document but as WindowActivate event fires several times it makes my addin slower..
hence i've set the object to nothing .. which causes event to be fired once.
You might thought, so whats the problem..??!! well, as soon as i set object as nothing.. it stops futher firing generating NewDocument event or anything else..
So .. no more addin loaded in new Document generated by clicking on new.
HELP...
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Please do us a favour and make your message easier to read, then we will be more inclined to help.
If you're calling the function on the OnStartupComplete of Word, then of course it will return an error as there is currently no ActiveDocument yet (i.e. no document is opened).
You should call the function on appropriate events such as when a document is opened or new document is created. This way you can be sure that there is an Active Document.
If you need further help, you probably might want to explain what is it that your function is doing.
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
My prob. starts with a looong histry..
First of all i;ve created word addin.. which when removed leaves the trace behind. I mean my_button(added in File Menu) is left there on word document.
I solved this NOTORIOUS problem using Normal.DOT way, like this
[CType(applicationObject, Word.Application).ActiveDocument.Saved = True]
and it get solved.
now, the problem occurs whenever i open and existing document.
Reason: As there is no ActiveDocument, the code above gives me an error
To solve this problem, i've used word document's WindowActivate event to add my button to file menu, by following way..
OnStartupcomplete, i assigned application-Object to objW, like this,
wObj = CType(applicationObject, Word.Application).Application
and then add my own menu button to File-Menubar of word, like this:
[applicationObject.CommandBars.item("File").Controls.Add(MsoControlType.msoControlButton, 1, "", 6, True)]
well, i do check of if button already exists or not.
Now Problem arouse, as WindowActivate Event fires many times, that makes my pgm sick. So in solution of that, i have set objW = nothing
which causes No more WindowActivate event(Only once) and still code runs fine.
Setting objW = nothing raises one more error:
Now as i create a new Document from File>New, the addins button not loaded in it as no event fired !
I'm trying all different events for this and different approaches for this, but all invain.. of no use or just not working..
Your replies gives me new hope to work on for the solution.. thanks for ur replies... if u find any line confusing .. do ask .. Thank you
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Ok, let's see:
Kedar V wrote: First of all i;ve created word addin.. which when removed leaves the trace behind
You should add the buttons as temporary buttons only (in your code) so they disappear when your add-in is removed/not working.
Kedar V wrote: he problem occurs whenever i open and existing document.
Reason: As there is no ActiveDocument, the code above gives me an error
You probably called your function in the wrong event. The DocumentOpen event should have an ActiveDocument in it (which will be the document you've just opened). And obviously placing your code in WindowActivate is the wrong step.
You also only need to add your button ONCE, not multiple times as this works in all instances of the documents, so I recommend in your function to check whether the button already exist or not. If yes, then do not add/attach the event anymore.
Your application probably slowed down due to multiple event handlers being attached to the same button.
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
"...buttons as temporary buttons only (in your code) so they disappear when your..." > this is not the case with WORD as it saves every thing in the tamplete, normal.dot , and i have already solved it, as stated code earlier !
Also there are no multiple button being displayed as ive done proper CHECKing..
the only prob. i have is: button not show-up in existing word document !!! or whatever i;ve stated in earlier reply..
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Hi
how to decrypt the which has hashed using SHA256
3DES may help
thanks
|
|
|
|
|
You can't decrypt it. It's a one-way only encryption used for storage, not message transfer. The only way to find out what's in it is to guess at the contents, hash your "guess" using the same algorithm then compare the hash value to the one you want to "decrypt". If the guess is wrong, change your guess, rehash it, and do the comparison again. Rinse and Repeat. This will probably takes a couple years...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I think he asked the question a couple of days ago - But he obviously didn't like the answer then.
|
|
|
|
|
Yeah, but maybe if we keep using bigger hammers, he'll get the idea!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|