|
|
Thanks. I added a splash screen and a form to my project, set the splash screen in the project's properties, and added the following code to the ApplicationEvents.vb:
Protected Overrides Function OnInitialize(ByVal commandLineArgs As _
System.Collections.ObjectModel.ReadOnlyCollection(Of String)) As Boolean
Me.MinimumSplashScreenDisplayTime = 5000
Return MyBase.OnInitialize(commandLineArgs)
End Function
And it worked correctly. The splash screen was shown for 5 seconds. I targed .Net 3.5, too. I'm sure this isn't helpful but I just wanted to confirm for you that the code on that MSDN page did work so you might want to double-check your code.
|
|
|
|
|
Hi
How can i convert hashcode in string
Like this hashcode
-694847
Any idea would be appreciated
Thanks
Unless u don't give ur hundred percent whatever u r doning till there is no result of ur work...
|
|
|
|
|
~V~ wrote: convert hashcode in string
isn't possible
you can only hash as string and compare it to the hascode you have
|
|
|
|
|
The ToString method will turn -694847 into "-694847".
If you mean that the hash code is created from a string, and you want that string back, that's not possible. There is nearly an infinite number of strings sharing the same hash code.
For fun, I tried to calculate the number of possible strings sharing the same hash code, but the calculator in windows can't handle numbers nearly that big...
Despite everything, the person most likely to be fooling you next is yourself.
modified on Friday, July 18, 2008 1:55 PM
|
|
|
|
|
Thanks to both of U for ur information
Unless u don't give ur hundred percent whatever u r doning till there is no result of ur work...
|
|
|
|
|
~V~ wrote: Unless u don't give ur hundred percent whatever u r doning till there is no result of ur work...
A good ambition, but not something that you can count on.
(And somewhat ironic that you don't make the effort to write out words like "you", "your" and "are"... )
You should know that no programmer ever delivers 100% all of the time. You always make mistakes from time to time, so you should write the code in a way so that the compiler catches most of the mistakes, and so that you get proper error messages when anything goes wrong.
You should generally strive to make your code as simple as possible, not as clever as possible. Consider one of my favorite quotes:
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
- Brian W. Kernighan
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: doning
He might want to check his spelling too
Guffa wrote: somewhat ironic that you don't make the effort to write out words like "you", "your" and "are"
That's funny. I found the not spelling it out rather annoying. Fighting the urge to down vote him just for that.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Nice quote, and very fitting
|
|
|
|
|
Hi Guffa,
It doesn't matter if you don't like my quote
Everybody should be aggree with me its not compulsory
And bytheway
you worte
You should know that no programmer ever delivers 100% all of the time
And somewhat ironic that you don't make the effort to write out words like "you", "your" and "are"...
I used U,Ur,R because its a new style to write the quote not the vb.net code where we have to write correct word
But My 100% means your 100% effort not the 100% time
Anyways thanks once again for answered my question
Unless u don't give ur hundred percent whatever u r doing till there is no result of ur work...
modified on Saturday, July 19, 2008 7:45 AM
|
|
|
|
|
I have an XL Macro that does mostly what I need, but I want to print just two sheets, one called "Purchase Order" and one called "Delivery Schedule".
I think I need something like ...
Sheets(Array("Purchase Order", "Delivery Schedule")).Select
Print.Selection
But I am having probs
I am not very good at vba,where am I going wrong, as this is not working!
I suspect I am not creating the Printer as an object and I don't know enough about how to do this
Can anyone help?
------------------------------------
"I want you to imagine I have a blaster in my hand" - Zaphod Beeblebrox.
"You DO have a blaster in your hand" - Freighter Pilot
"Yeah, so you don't have to tax your imagination too hard" - Zaphod Beeblebrox
|
|
|
|
|
Try this:
Sheets("Purchase Order").Printout
Sheets("Delivery Schedule").Printout
The sheets will print to the current default printer.
To change the printer on-the-fly, use:
Application.ActivePrinter = <queue name="">
Hope that helps!
Tim
|
|
|
|
|
Thanks, That Solved it!
I have been looking so closely at getting the dataset right that I forgot how to print!
Thanks also for the Application.ActivePrinter Line! I will incorporate that once I get the barebones working.
just to let you know, this is my FIRST ever SOLO project, all alone, no help except for this question, and I am learning LOADS.
------------------------------------
"I want you to imagine I have a blaster in my hand" - Zaphod Beeblebrox.
"You DO have a blaster in your hand" - Freighter Pilot
"Yeah, so you don't have to tax your imagination too hard" - Zaphod Beeblebrox
|
|
|
|
|
No problem...
We have environmental graphs that are maintained in Excel and printed weekly. Since I maintain the code, I knew where to look.
When we share our wealth of knowledge, we all have the opportunity to grow.
Tim
|
|
|
|
|
hi,
i open a form as showdialog as following to get input
If frmFindVehicle.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
txtNumber.Text = frmFindVehicle.ReturnNumber
End If
frmFindVehicle.Dispose()
and coding of Ok Dialog result button of form(frmFindVehicle) is following
If dgvModelList.SelectedRows.Count = 0 Then
mdChecking.Prompt("Please select Model from grid")
Exit Sub
ElseIf dgvModelList.SelectedRows(0).Cells(9).Value = Nothing Then
Exit Sub
End If
ReturnNumber = dgvModelList.SelectedRows(0).Cells(1).Value
my problem is that when ok button is pressed and No row is selected then form(frmFindVehicle) must be open and force user to select a row. In above case it simply prompt the message and return back to main form.
|
|
|
|
|
i'm assuming at design time your assigning the dialogresult.ok to the ok button. Don't do that. In the click events of the ok and cancel set the result there.
Ex:
private sub cmdOK_Click(sender as object, e as system.eventargs) handles cmdOK.click
.
.
.
'do your checking and get out if failed...
me.dialogresult = windows.forms.dialogresult.ok
close
end sub
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Thanks , its work.
Also nice quote which is in bottom part of your message
|
|
|
|
|
Hi,
alternatively you could perform the checks in the FormClosing event, setting
FormClosingEventArgs.Cancel if necessary; and possibly reading FormClosingEventArgs.CloseReason
|
|
|
|
|
Also check that your form does not have an accept button assigned (caters for enter being pressed on the form, cancel suports esc) as this will automatically do the dialog result assignment.
I have been in the position of having to delete a button that has been assigned to the AcceptButton on a form and recreate it with a different name to get rid of the assignment. Therefore I have a mix of btnSave and btnOk in my apps - very irritating.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Structure of my application is:
1. Message is dispatched to an application
2. That application puts the message in a private queue
3. Another application reads messages from this queue and then calculates the receivers (pager) for this message and then puts single message to different private queues based on receiver types (pager carriers)
4. In the end different receiver console applications are set using MSMQ Triggers such that whenever a message arrives in the private queue particular receiver console application is fired
Now this seems to run smoothly but after running for some time the messages seem to get stuck in the receiving private queues on which triggers are set
Now the problem could be in:
- receiving application that stalls due to large number of messages in peak time
or
- msmq trigger service working that stops firing those applications and the private queue starts building up
One thing to note is that when this situation occurs then starting the MSMQ Trigger Service solves the issue and stuck messages in the queue starts going.
I am using:
Windows Server 2000
MSMQ 2.0
MSMQ Trigger Services 1.0
.NET 1.1 (console applications)
Could someone help me out in this?
|
|
|
|
|
hi all,
i simply pick a image from FileBrowserDialog and assign it to Picturebox as following
Dim a As New OpenFileDialog
a.Filter = "BMP Files" & Space(5) & "(*.bmp)|*.bmp|Jpg Files" & Space(5) & " (*.jpg)|*.jpeg"
If a.ShowDialog = Windows.Forms.DialogResult.OK Then
PictureBox1.Image = Image.FromFile(a.FileName)
MsgBox(PictureBox1.Image.Size.ToString)
End If
after assigning, i check image size which is in Pixcel. Now i want to check that whether the Width and Height of image(which is in Pixel), is less than the size 6 3/8" x 2 3/8" (which is in centimeters). So how can i change the image size to centimeter and compare them?
|
|
|
|
|
Well, you want it in centimeters relative to what ? A given resolution will result in a different size image based on the size of the screen.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hello
I'm writting a custom exception class and I want to have functionality to go to line number where the error occured. The code below should work but it fails at first line(giving com exception)
Dim DTE As EnvDTE.DTE = System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.9.0")
Dim item As EnvDTE.ProjectItem = DTE.Solution.FindProjectItem(FileName)
item.Open(EnvDTE.Constants.vsViewKindCode).Activate()
Dim textSelection As EnvDTE.TextSelection = DTE.ActiveDocument.Selection
textSelection.StartOfDocument()
textSelection.MoveToLineAndOffset(LineNumber, ColumnNumber)
textSelection.SelectLine()
I found a sample(in C#) where the GetService function was called and I cannot find it in VB.NET. The IServiceProvider interface provides one but I cannot find object that implements it.
Thanks in advance for help
|
|
|
|
|
The DTE stuff is usually only used in macros, not normal application programming. Even if this were to work, it would require every user of the resulting application to have Visual Studio installed.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Yes they would need a refernece to the dlls.
And I have found the solution
Dim DTE2 As EnvDTE80.DTE2
DTE2 = System.Runtime.InteropServices.Marshal. _
GetActiveObject("VisualStudio.DTE.9.0")
This will find instance of VS 2008
|
|
|
|