|
Thank you for your response, I tried the code …I think it will work, but I found a problem to where I put it. I mentioned here that I used this check box as a db fields so I need to refresh the function for each record
Than you in advanced
chkBox1 ID
chkBox2 Driver Licence
chkBox3 Passport No
chkBox4 Birth Certificate
chkBox5 Bank Account
Lb1 Legal -if two or more from above checked
Lb2 Illegal -if less than 2
kami95
|
|
|
|
|
You need to put the code in an event handler that is set to fire whenever any of the five checkboxes has been checked/unchecked. It would look something like this:
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged, CheckBox2.CheckedChanged, CheckBox3.CheckedChanged, CheckBox4.CheckedChanged, CheckBox5.CheckedChanged
'Insert the code here
End Sub
Hope this works for you.
|
|
|
|
|
'//IDE: Visual Basic 6.0
'//My method:
'//First you must declare 5 boolean variables,
'//and Connect Database and read your 5 field that value put in 5 boolean variables,like this..
Dim blnID as Boolean
Dim blnDriverLice as Boolean
Dim blnPassNo as Boolean
Dim blnBirthCert as Boolean
Dim blnBankAcct as Boolean
'//Declare a count variable and initialize it
Dim intCheckedCount as integer
intCheckedCount=0
'//Omit db connection code...
'//Provided that your recordset is rs then
'//read field value from db like this
blnID=rs!ID
blnDriverLice=rs!Driver Licence
blnPassNo=rs!Passport No
blnBirthCert=rs!Birth Certificate
blnBankAcct=rs!Bank Account
'//If checked then count
If(blnID) Then intCheckedCount=intCheckedCount+1
If(blnDriverLice) Then intCheckedCount=intCheckedCount+1
If(blnPassNo) Then intCheckedCount=intCheckedCount+1
If(blnBirthCert) Then intCheckedCount=intCheckedCount+1
If(blnBankAcct) Then intCheckedCount=intCheckedCount+1
If(intCheckedCount>=2) Then
Lbl1.BackColor = RGB(255, 0, 0)
Else
Lbl2.BackColor = RGB(255, 255, 0)
End If
'//Finish
-- modified at 22:53 Tuesday 10th October, 2006
|
|
|
|
|
Hi guys,
Iam on deploying my application using excel interop, it worked perfectly in XP but my application intend to run on NT, just found out that NT doesnt support interop dlls.
any other approach for this?
or anyway that i can have the interop dll attached to my application?
tnx in advance.
-::maximus::-
|
|
|
|
|
Hello,
let's say that you have an application with 50+ tables. the most of them are related to each other by their category(eg. customers->cust_categories->cust_types, products->prod_categories->prod_types, etc).
You make a HUGE dataset which have all database contents and use it whenever you need it or you make small datasets even if some of the tables such as "color" for example are exist more than once in these datasets?
thanks in advance,
John
|
|
|
|
|
jlabrou_grc wrote: You make a HUGE dataset which have all database contents and use it whenever you need it or you make small datasets even if some of the tables such as "color" for example are exist more than once in these datasets?
I'll take the third option: I don't use Datasets at all - especially if it is going to be large. DataSets are just not performant on large sets of data - the database is.
|
|
|
|
|
Hi All,
I am developing a windows based application where I am using System.Drawing.Printing.PrintDocument class for displaying report. I have provided design screen where user can change the font size and type. Now I am facing problem while printing. If I change the font size, I am loosing data and total information is not being displayed. Now my question is there any way to find out font width and height of the font object. Specifically not size. I know there is a method to find size. But its of no use to me. I need width and height separately.
Thanks in advance,
Regards,
Krishnaraj
|
|
|
|
|
There is no real height and width of a font object, since most fonts are not monospaced, there is no real character cell you can use to estimate how wide your string is.
There's two ways to go about this. You actually have to use Graphics.MeasureString to get the dimensions of the drawn string to see how big it is in the supplied font. If it's too big, reduce the font size and try again. Keep doing so until the string fits.
Or, I've found a second method that works in limited cases, but it's MUCH quicker if performance is an issue. Instead of drawing the string the exact size you need it, draw it to an offscreen bitmap in a MUCH larger font size, like 96 points. Then draw the bitmap in the control you want, scaled up/down to the size you need. If done properly, it draws nicely, without all the jaggies you get when scaling an image.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how to set form transperancy in visual basic6.0.if i set .jpg image as form
background how can i get transperancy.if it is in rectangle or any shape else.please send a solution.if i get a solution on this my project is going to be complete.please do me the favour.
mail id: suryapraba_mca@yahoo.com
suryapraba
|
|
|
|
|
Google for "vb6 nonrectangular form[^]" and you'll find the few remaining VB6 examples of this.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi, I want to dispaly a DICOM image(dcm) in picture box in picture box, and print this image. Can anybody help me?
|
|
|
|
|
Nothing in the .NET Framework supports DICOM images, so you'll have to convert them to BMP before you can use any of the standard controls to display them. Googling for "vb.net convert dicom to bmp" reveals this[^]. The first link is an article right here on CP.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thanks for you corporation, actully I want to load an dicom image and add a bmp image to this dicom image and then I want to print it, Can you help me in this?
|
|
|
|
|
I've never dealt with DICOM images before.
It sounds like you would be much better off using a library that handles DICOM images for you. Google results[^]
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hey,
Does anyone know how to embed Firefox into a program?
|
|
|
|
|
AKAIK, FF doesn't have a COM component you can embed into your app.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hey,
I can't find anyway to get information about the processor on a computer. I am basically looking for the CPU usage and especially the temprature of the processor. Can anyone help?
|
|
|
|
|
You can get the CPU usage using the PerfromanceCounter[^] class.
CPU Temperature doesn't have a PerformanceCounter so you'll have to use a different method to get this. You can find out more, especially the limitations of doing so, reading these[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all, I am getting really stressed and I was hoping someone could help me out. I am trying to add some rows to a table using table adapters in VB.net 2005 express and sql server express. I have read the stuff on the MSDN site and it still does not work does anybody have any ideas.
Thanks,
|
|
|
|
|
ranro2006 wrote: I am trying to add some rows to a table using table adapters in VB.net 2005 express and sql server express. I have read the stuff on the MSDN site and it still does not work does anybody have any ideas.
Would you like to tell us exactly what you did? (Code samples are good for that) You may have misinterpreted what you read, but we can't tell that from your description. We may not have read the same documentation so that narrows down the list of people that can potentially help.
|
|
|
|
|
Hi All
I am trying to run a batch file in a windows service.
It seems to sort of work as I can see a cmd.exe process running when the service executes it but the batch file does not seem to run the contents of the batch.
I am using process.start("c:\mybatch.bat")
I run the service under my admin account.
When I run a similar program in vb.net forms app it works fine.
can anyone help or have any suggestions to rectifiy this ?
Cheers
Dom
|
|
|
|
|
Try using: System.Diagnostics.process.start("C:\mybatch.bat")
Caffeination, fuels the programming nation!
|
|
|
|
|
|
Try: shell("C:\mybatch.bat")
|
|
|
|
|
thanks ultracoder
still no good however
i hate/love programming
|
|
|
|