|
Have you tried declaring your fonts with the full declaration i.e System.Drawing.Font . I have had this problem before and it was a conflict with another class that had a Font property (I tink it might have been the Excel Interops IIRC). Then try also declaring FontStyle.Bold as System.Drawing.FontStyle.Bold , just to avoid any Namespace conflicts.
Happy Coding
|
|
|
|
|
Yes i try this but nothing happen.
If you can think then I Can.
|
|
|
|
|
The error is encountered because the constructor cannot convert double to float implicitly. You need to add "F" to your font sizes in order for the constructor to determine that it is a float.
Dim f1 As New Font("Arial", 8.25F)
Dim f2 As New Font("Arial", 8.25F, FontStyle.Bold)
|
|
|
|
|
I had mistake to define my SQL Server database table with all columns with TEXT, with my DataGridView the following codes are working fine (it will show every thing with its randome order):
cmd = New SqlCommand("SELECT * FROM GuestInfoStore", con)
If con.State = ConnectionState.Closed Then con.Open()
myDA = New SqlDataAdapter(cmd)
myDataSet = New DataSet()
myDA.Fill(myDataSet, "MyTable")
DataGridView_INFO.DataSource = myDataSet.Tables("MyTable").DefaultView
In my table, there is a column FirstName, if I use:
cmd = New SqlCommand("SELECT * FROM GuestInfoStore ORDER BY FirstName", con)
I will have an error since SQL can't compare with Text column, but it is too late for me to change FirstName column back to char(50) or so ... can anyone help me on this?
Thank in-advanced 
|
|
|
|
|
Curious 2009 wrote: it is too late for me to change FirstName column back to char(50)
it is never too late to fix a mistake. Things can only get worse if you don't.
You could:
- add a field with the correct type;
- automatically copy the existing field to the new one;
- gradually adapt your software, first the field producers (methods that write the field): make them write both fields; then the field consumers (the methods that read the field): make them read the new field.
- when all is done, remove the redundant field.
The alternative is a lot of ugly code, that will grow and grow over time, as you keep adding features.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
You are right & I will do as you suggested!
Thank 
|
|
|
|
|
Good.
If it is a simple TEXT->VARCHAR change, I think you can tell SQL Server to do that in place, in a single step. I haven't so far, I have done similar things with MySQL.
It is trickier when more complex formatting is involved, such as string->DateTime. It is always safe to make an extra field as a backup!
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I did copy & it works, I will try to find the command for simple TEXT->VARCHAR change
Thank again
|
|
|
|
|
There is a management tool SSMS, that should be able to do such operations interactively.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Following is the code sample used to display the outlook folder dialog using VB.NET
[VB.NET CODE STARTS]
Dim objOutlook As Object
Dim objOlNamespace As Object
Dim objOlFolder As Object
objOutlook = CreateObject("Outlook.Application") ' create outlook application object at the run time
objOlNamespace = objOutlook.GetNamespace("MAPI")
objOlFolder = objContactsNS.PickFolder ' displays the folder dialog
[VB.NET CODE ENDS]
http://www.mindfiresolutions.com/Open-Outlook-folder-dialog-and-select-folder-using-VBNET-896.php[^]
Cheers,
Eliza
|
|
|
|
|
Garbage. Utter garbage. And it doesn't have anything to do with the original posters problem.
|
|
|
|
|
I have created an application using biometric SDKs in VB.net 2005.
Noy I want to deploy it in windows 7 but setup is not working in windows 7. However, its working in XP and xp servers. Is there any way to create a setup for windows 7??
|
|
|
|
|
have you tried the setup by running in compatibility mode?
Right click the setup file, select properties, then the Compatibility tab............
|
|
|
|
|
Try to run it as administrator. This has helped me somethimes.
Tosch
|
|
|
|
|
Same problem I have faced few days ago. The problem was accessing registry. The Key i was looking for that is common in XP. SO I thought W7 would have that key. But W7 don't. There was no error handler. Then I add a try catch statement which solved that problem.
Ayesha.Hafeez:"I have created an application using biometric SDKs in VB.net 2005."
Try Create another app just having a simple form & try again in W7. If success your 1st app must have some error which are not handled.
|
|
|
|
|
Hello, this is Vikash Gohil.
I have a windows service that takes data from the database and does some processing on that data.
I have also added licencing functionality to the service so that people using it will require to register with us. Initially the service would run in trial period and would expire after 30 days.
Now I want the below functionality.
I want to add a User Interface in the Service which will popup when user clicks on SysTray icon of my service. This UI would allow user to Register service using a Licence file on trial period expiration.
And also when registeration form is open, i want the service to pause as i am using sleep command in my service, which will lock the UI if service is running.
Can someone provide me some idea how to do it.
Any help would be greatly appreciated.
Thanks in advance. Awaiting a reply soon.
|
|
|
|
|
You don't do this stuff in the Service. You do it in a seperate application that puts it's interface behind the tray icon and talks to the service through whatever interprocess communcation channel you like.
|
|
|
|
|
hiya im trying to make a game where a lable(at the moment) displays a value and the user has to drag numbers to add to that amount. I have four PB's 2 seperated by a +
sign and then the therd and fourth by an = sign basicly 1 + 2 = yada. in stead of the lable I want to display the value after the = sign
my idea is to seperate the value into it's tens and units but just cant think of how to do it.
if anyone can point me in the right direction I would be very greatful
sorry forgot to mention im using VS 2008
cheers
J
|
|
|
|
|
How about Sum.ToString() ? Or is there more that you haven't mentioned?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
You need to try something like this (assuming txtNumberToSplit contains the Number) ,
Dim strNumber As String = txtNumberToSplit.Text
lblOnes.Text = strNumber(strNumber.Length - 1)
lblTens.Text = strNumber(strNumber.Length - 2)
lblHundreds.Text = strNumber(strNumber.Length - 3)
lblThousands.Text = strNumber(strNumber.Length - 4)
lblTenThousands.Text = CInt(strNumber / 10000)
Hope this is what you were looking for.
Happy Coding.
This would be more robust
Dim strNumber As String = txtNumberToSplit.Text
If strNumber.Length > 0 Then lblOnes.Text = strNumber(strNumber.Length - 1) Else lblOnes.Text = 0
If strNumber.Length > 1 Then lblTens.Text = strNumber(strNumber.Length - 2) Else lblTens.Text = 0
If strNumber.Length > 2 Then lblHundreds.Text = strNumber(strNumber.Length - 3) Else lblHundreds.Text = 0
If strNumber.Length > 3 Then lblThousands.Text = strNumber(strNumber.Length - 4) Else lblThousands.Text = 0
lblTenThousands.Text = CInt(strNumber / 10000)
|
|
|
|
|
cheers all for the replys I forgot to update the thread
what I have done 3 fuctions but probley reduce them down to one:
Public Function Hundreds()
Dim H As Int16
H = CInt(My.Forms.Form1.lblValue.Text)
H = H \ 100
Return H
End Function
Public Function Tens()
Dim T As Int16
T = CInt(My.Forms.Form1.lblValue.Text)
T = (T Mod 100) \ 10
Return T
End Function
Public Function Units()
Dim U As Int16
U = CInt(My.Forms.Form1.lblValue.Text)
U = (U Mod 10)
Return U
End Function
thanks again for the replys
J
|
|
|
|
|
At the link below, there is an article on this site that provides code to install a program registration system, but the instructions on how to use the code is a bit vague. I posted a question following the article, but thought I may have a better chance of receiving help by posting here. Can anyone provide me with a better explanation on how to install this code into my project?
<a href="http://www.codeproject.com/KB/vb/registration.aspx">VB.NET 2003 User Registration Form (2.1)</a>
|
|
|
|
|
I haven't actually used this code, but reading the instructions, it seems quite clear to me. What is the problem you encounter?
|
|
|
|
|
Thanks for the response. My first thought was to interpet the instructions literally and add two forms to my project. This does not work 1) because the the project can not have two forms with the same name, and 2) the registration program has more the two forms.
I then added the registration project as an existing project to my project. There were actually three projects in the registration program so I left the "About" project out.
Once I set the registration project to be the startup project, the registration program does begin, however it gives me a registration program error, telling me that my computer date has been changed and will not continue. Once I disable that section of code, I can now see the registration menu.
I am now to the point that I need to learn how to have one project call a form in a second project. I will still need to circle back to the date issue because something is clearly wrong there.
Any help on the proper code to have the registration program call my original Form1 when the registratio "Continue" button is clicked would be appreciated.
|
|
|
|
|
I have not read said article, however:
- you can freely choose the names of all Controls you use; it is bad practice to keep the names suggested by Visual Designer (such as Form1 and Button1) as these are not functional names within your application domain.
- I see no need to have two projects here, the whole idea is to combine the article's code with yours in a single project.
I suggest you get more acquainted with VB and study the article and its code.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|