|
Anybloodyid wrote: when attempting to print to a non-existent printer
If the printer doesn't exist, you can't print to it. Are you asking if the printer object exists, but is unavailable??
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
Why would you want to do this? I've paused print queues before so I could stack up jobs and go load different paper into a printer before they printed. Isn't this an option best left up to the user?
Ask yourself these questions first. Have you seen this kind of functionality in any other Windows app before? Why or why not?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
|
Hello,
Looking for everyone's opinion:
If my application references files/objects that aren't actually used in the app. does this "hurt" performance or is dotnet smart enough to realize that those aren't used so there is no performance hit.
Ex: I have a suite of controls that most of the time only 2 or 3 are used out of 10. I have a developer that referenced all 10 even though his app only used 2, then does the other 8 make an impact?
Thanks,
Nathan
-- modified at 14:12 Monday 2nd April, 2007
|
|
|
|
|
nlarson11 wrote: If my application references files/objects that aren't actually used in the app. does this "hurt" performance
No. Only the stuff that gets used affects performance.
nlarson11 wrote: Ex: I have a suite of controls that most of the time only 2 or 3 are used out of 10. I have a developer that referenced all 10 even though his app only used 2, then does the other 8 make an impact?
No. Again, only the stuff that gets used affects performance. If you don't use a control in a library, it can't affect the apps performance. That is, unless the library is HUGE in size and it takes forever to load the assembly. But 10 controls in your library won't make any difference at all.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thanks Dave for replying...
Sorry for not being more clear...I guess that what I'm really getting at: the start up time...is it impacted by "dead" references?
|
|
|
|
|
No since references that are never used don't make it into the final .EXE.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
great... thank you sir...
|
|
|
|
|
is there any possible keyword in vb.net that can get me
out of the case loop under the select statement..
i want it to work exactly like c++
plz help
|
|
|
|
|
|
I though this question looked familiar[^].
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
man exit select select let us out of the select statement..
what if i m using 3 case loops inside n i want to exit those case loops
whenever the condition is not true, n jump on to the next case
|
|
|
|
|
You don't have to do anything. There is no break in VB because it happens automatically.
If the first Case isn't true, Select automatically jumps to the next Case and tests it, and so on down the line until it find one that is True or it gets to Case Default .
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
The WSDL appears to work file when browsing the web service using the URL in
IE. I even enabled remote testing on the page and was able to successfully test. Trying to call the web service in my VB Windows application fails as indicated and I recieve System.net.webException with no blank error message.
|
|
|
|
|
Hey guys, I'm making a program that creates a customized message box, but it keeps giving me an error. The "IconChoice" variable determines what icon shows up in the messagebox, the "ButtonChoice" variable determines what buttons will show up, and the "DefaultButton" variable determines which button is the default one. The txtMessage and txtTitle are the box's text and title. Here's the code:
<code> Dim IconChoice As String
Dim ButtonChoice As String
Dim DefaultButton As String
Private Sub radbtn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radbtn1.Click
raddef1.Enabled = True
raddef2.Enabled = True
raddef3.Enabled = True
raddef4.Enabled = False
raddef5.Enabled = False
raddef6.Enabled = False
raddef7.Enabled = False
ButtonChoice = "MessageBoxButtons.AbortRetryIgnore"
End Sub
Private Sub radbtn2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radbtn2.Click
raddef1.Enabled = False
raddef2.Enabled = False
raddef3.Enabled = False
raddef4.Enabled = True
raddef5.Enabled = False
raddef6.Enabled = False
raddef7.Enabled = False
ButtonChoice = "MessageBoxButtons.OK"
End Sub
Private Sub radbtn3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radbtn3.Click
raddef1.Enabled = False
raddef2.Enabled = False
raddef3.Enabled = False
raddef4.Enabled = True
raddef5.Enabled = True
raddef6.Enabled = False
raddef7.Enabled = False
ButtonChoice = "MessageBoxButtons.OKCancel"
End Sub
Private Sub radbtn4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radbtn4.Click
raddef1.Enabled = False
raddef2.Enabled = True
raddef3.Enabled = False
raddef4.Enabled = False
raddef5.Enabled = True
raddef6.Enabled = False
raddef7.Enabled = False
ButtonChoice = "MessageBoxButtons.RetryCancel"
End Sub
Private Sub radbtn5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radbtn5.Click
raddef1.Enabled = False
raddef2.Enabled = False
raddef3.Enabled = False
raddef4.Enabled = False
raddef5.Enabled = False
raddef6.Enabled = True
raddef7.Enabled = True
ButtonChoice = "MessageBoxButtons.YesNo"
End Sub
Private Sub radbtn6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radbtn6.Click
raddef1.Enabled = False
raddef2.Enabled = False
raddef3.Enabled = False
raddef4.Enabled = False
raddef5.Enabled = True
raddef6.Enabled = True
raddef7.Enabled = True
ButtonChoice = "MessageBoxButtons.YesNoCancel"
End Sub
Private Sub radicon1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radicon1.Click
IconChoice = "MessageBoxIcon.Asterisk"
End Sub
Private Sub radicon2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radicon2.Click
IconChoice = "MessageBoxIcon.Error"
End Sub
Private Sub radicon3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radicon3.Click
IconChoice = "MessageBoxIcon.Exclamation"
End Sub
Private Sub radicon4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radicon4.Click
IconChoice = "MessageBoxIcon.Hand"
End Sub
Private Sub radicon5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radicon5.Click
IconChoice = "MessageBoxIcon.Information"
End Sub
Private Sub radicon6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radicon6.Click
IconChoice = "MessageBoxIcon.None"
End Sub
Private Sub radicon7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radicon7.Click
IconChoice = "MessageBoxIcon.Question"
End Sub
Private Sub radicon8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radicon8.Click
IconChoice = "MessageBoxIcon.Stop"
End Sub
Private Sub radicon9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radicon9.Click
IconChoice = "MessageBoxIcon.Warning"
End Sub
Private Sub raddef1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles raddef1.Click
DefaultButton = "MessageBoxDefaultButton.Button1"
End Sub
Private Sub raddef2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles raddef2.Click
If radbtn1.Checked Then
DefaultButton = "MessageBoxDefaultButton.Button2"
Else
DefaultButton = "MessageBoxDefaultButton.Button1"
End If
End Sub
Private Sub raddef3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles raddef3.Click
DefaultButton = "MessageBoxDefaultButton.Button3"
End Sub
Private Sub raddef4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles raddef4.Click
DefaultButton = "MessageBoxDefaultButton.Button1"
End Sub
Private Sub raddef5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles raddef5.Click
If radbtn6.Checked Then
DefaultButton = "MessageBoxDefaultButton.Button3"
Else
DefaultButton = "MessageBoxDefaultButton.Button2"
End If
End Sub
Private Sub raddef6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles raddef6.Click
DefaultButton = "MessageBoxDefaultButton.Button1"
End Sub
Private Sub raddef7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles raddef7.Click
DefaultButton = "MessageBoxDefaultButton.Button2"
End Sub
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
MessageBox.Show(""" & txtMessage.Text & """, """ & txtTitle.Text & """, ButtonChoice, IconChoice, DefaultButton)
End Sub</code>
|
|
|
|
|
You can't use string values as if they were enum values. Declare the variables as the proper enums instead:
Dim IconChoice As MessageBoxIcon<br />
Dim ButtonChoice As MessageBoxButtons<br />
Dim DefaultButton As MessageBoxDefaultButton
Now assign the variables the enum values instead of strings:
IconChoice = MessageBoxIcon.Stop<br />
ButtonChoice = MessageBoxButtons.YesNo<br />
DefaultButton = MessageBoxDefaultButton.Button3
Now the variable will work in you call to MessageBox.Show .
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi all !
I have a file Info.dat, Now i want to read content of this file( I know struct of this file). how can i do ? Thanks a lot. Please send to caoquanghanh@yahoo.com
example:
Type PutAd_File
TradeID As Integer
SecNo As Integer
vol As Long
price As Double
FirmNo As Long
Side As String * 1
Board As String * 1
Time As Long
Flag As String * 1
End Type
hanhquang
|
|
|
|
|
caoquanghanh wrote: Please send to caoquanghanh@yahoo.co
Expect answer in the forum, not to your email. This is not a billboard.
caoquanghanh wrote: I have a file Info.dat, Now i want to read content of this file( I know struct of this file). how can i do ?
You can use the BinaryReader class to read the data from the file.
---
single minded; short sighted; long gone;
|
|
|
|
|
I can't find BinaryReader class wijt VB code. Can you help me. thanks alot
hanhquang
|
|
|
|
|
System.IO.BinaryReader
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi All,
Can anybody tell me how to read the PDF file to get the data line by line without using any third party control.
Thanx in Advance
Max
|
|
|
|
|
I'm Subrahmanyam .I have a small problem in using list box.The problem is like this
i'm doing a windows applcation.
In this i have a textbox and a list box which contains list of items .
If i type 'c' or any letter in the text box then the cursor should
automatically go to
the word that starts with 'c' and that element should be the 1 st one
in the list .
i'm trying to do with findstring method but unable to do it.
so i request you to help me in this.
Thanking You Sir,
Regards,
Subrahmanyam.
|
|
|
|
|
Are you doing:
dim idx as int = listBox.FindString(textbox.text)
listBox.SelectedIndex = idx
???
You need to set the selectedIndex property in the ListBox.
Note if the idx value is -1 then it didn't find the string.
Hope that helps.
Ben
|
|
|
|
|
I am building an application in VB.BET and ADO.NET.
The application requires searching only. The searches are on wide varity of criteria and huge tables. The output resultsets may also be very big or small depending on the query.
The backend being used is Microsoft Access.
The search fields are usually indexed. Before switching over to ADO.NET, I was programming in VB6 and used SEEK which proved to be very fast. But I find no similar thing in ADO.NET.
So given that No add/update is required, only searching is required,
1. What is the best alternative to SEEK in ADO.NET?
2. Which data mining technique should suit better? - Dataset or datareader.
3. How can I optimize queries on Memo fields?
4. Tips for faster searching and best practices.
Thanks a lot in advance for those who reply. Even small hints would be very appreciated. Please do not hesitate to answer even if you are not very confident or you can help me with even one of the questions mentioned above.
|
|
|
|