|
I have a problem with GUI design and would be interested what anyone else would do.
My client wants their users to be able to change the system time to another date other than NOW(). What they have requested is a checkbox be placed on a form and when ticked a dialog pops up with a date-time pick on it from which the user can select the new system date. I have presently put OK and CANCEl buttons on the said dialog. If the user has changed the date to other than NOW() and hits OK then the system date is updated, otherwise clicking on CANCEL leave the system date un-changed. If the system date remains as NOW() the check-box is then un-ticked otherwise it is ticked.
The problem I have is that if the system date is already something other than NOW() and they wish to change the date to some other date but still not NOW(), clicking on the check-nox obviously un-ticks the checkbox and desn't then show the said dialog they have to tick the checkbox a second time to get the dialog to show.
I think the checkbox isn't quite the correct widget to use. They don't want the date to be visible until the dialog is displayed.
Any advice would be appreciated.
|
|
|
|
|
I think so you are having a problem,
As per the problem i understand is When you open the dialog box to display and store it in a variable the system time and date is stored.
But when the user selects Ok button or cancel button the time gets changed.
When you next call now function.
it is better to use date function and time function
this will give you the current time and todays date.
Thanks!
Manoj Madhavan;)
|
|
|
|
|
I wanna display hyper-text in my program. like this is an example. IE control is quite slow. Is there a text control for that?
|
|
|
|
|
you can use the Richtextbox, but thats big as well Try using the IRLLabel if you can make it work.
|
|
|
|
|
How can you convert an icon to a bitmap without losing all of its quality.
So .ToBitmap loses its alpha channel.
What is the solution?
http://www.nico.gotdns.com
|
|
|
|
|
Bitmaps don't support an alpha channel natively. Usually when a bitmap is drawn "transparently" it uses what's called a bitmask (or mask for short).
Alternatively, you could try another format like GIF, PNG, TIFF, etc. that do support an alpha channel.
Jeremy Falcon
Imputek
|
|
|
|
|
But how do you convert an icon in VB.NET code to such a format???
http://www.nico.gotdns.com
|
|
|
|
|
How do you do this then??
http://www.nico.gotdns.com
|
|
|
|
|
dear all,
1)how do i add hexadecimal numbers in vb (result too in hexadecimal numbers)
2) if there are 4 hexadecimal numbers say
0x40
0x80
0x1000
0x2000
and i have a number 0x10C2 (which is the hex sum of the top 3 numbers).
now using such a number (which is the sum of any of the above hex numbers ) can i find which of the above numbers are included in the sum if it is ensured that a number is added only once.
thnx in advance
|
|
|
|
|
- In VB/VB.NET, hexadecimal numbers are prefixed with
&H , not 0x .
You use hex numbers in exactly the same way as decimal numbers, e.g. Dim i As Integer = &H40 + &H80 .
To print the result as a hex number, use i.ToString("X") in VB.NET, or Hex(i) in VB6. - The sum of the first three numbers is 10C0, not 10C2.
You can use the And operator to find the numbers. For example:
Dim number As Integer = &H10C0
Dim sum As String
Dim i As Integer
i = 1
Do While number > 0
If 0 <> (number And i) Then
If Len(sum) > 0 Then sum = sum & " + "
sum = sum & Hex(<span title="Whoops!">i)
number = number - i
End If
i = i * 2
Loop
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
rishabhs wrote:
thanx for ur reply Richard! [rose]
but the code u gave me doesn't returns all the numbers which r added to get the number &H10C0
plz. help me understand the logic of this job
I fixed a typo in my previous post, which should give you the correct result. [You need sum = sum + Hex(i) , not sum = sum + Hex(number) . ]
The code walks through each binary bit of the number, and tests to see if that bit is set, using the bitwise And operator. [0 <> (number And i) ]. If the bit is set, it appends the hex representation of the bit to a string.
0x10C0 = 0001 0000 1100 0000
= 0000 0000 0100 0000
+ 0000 0000 1000 0000
+ 0001 0000 0000 0000
= 0x0040
+ 0x0080
+ 0x1000
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
thanx a lot
|
|
|
|
|
Hello guys ... I want to write an application which use Wave Pedal. From where i want to start this application. How inputs from Wave Pedal catch in application ....
Actually i do not know from where i get Helped that's why i posting here.
I hope u guys helped me in any way ...
any artical, any web site, any code, any thing .... will help alot
Thanx in advance ...
|
|
|
|
|
I want to know how to send and read bytes to LPT port(parallel port) using VB
|
|
|
|
|
i have 2 images and when mouse goes over 1 the other shows. how do i code it?
i started out putting picture box. am i on the right way? im a rookie so plz be specific. thank you.
|
|
|
|
|
First you should reference "System.Drawing" by right clicking on references or add "Imports System.Drawing" to the top of your project.
In the class name dropdown (above your code) choose the command button and next to that in the method name dropdown choose MouseHover/MouseLeave. Enter code similar to the following:
Private Sub Button1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseHover
Button1.Image = Image.FromFile("D:\Source\App.ico")
End Sub
Private Sub Button1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseLeave
Button1.Image = Image.FromFile("D:\Source\Add.ico")
End Sub
|
|
|
|
|
Hi All
I was trying to print the powerpoint files through my program.
the program opens the file, sets the print options, prints it and closes it..
the program has no error, but the line to close the file get executed while the file is printing. How can I wait all the slides in the file get printed and then quit MS PowerPoint?
thanks
|
|
|
|
|
I want to do a sort of the data in a MSHFlexGrid and only when the user clicks in the ColHeader. How can I detect that the user clicked in the ColHeader and the correct column clicked in?
|
|
|
|
|
All you need to do to check that the user clicked on the header column is to have a condition that checks that the fgrid.MouseRow = 0, and to read the column clicked on use fgrid.MouseCol. Both are 0 based.
Cheers
|
|
|
|
|
i know that it is possible to disable a column in a datagrid by using Datagrid1.Columns("Field").Locked = true. is it equally possible to disable a row? for example, i wish to disable a row in 2 of the values in the row are the same (quantity and quantity in), but i do not know how to reference it. The only other column in the row is Product Code which is unique. is there any way to do it - thanks in advance for any help!
|
|
|
|
|
With Adodc4.Recordset
.MoveFirst
Do While Not .EOF
Dim strPriceCode As String
strPriceCode = DataGrid1.Columns("PriceCode")
Dim codeSQL As String
codeSQL = "Select PriceCode " & _
" From PriceDescription " & _
" Where PriceCode = '" & strPriceCode & "'"
Set RS = Conn.Execute(codeSQL)
If RS.BOF And RS.EOF Then
MsgBox " '" & strPriceCode & "' Price code does not exist - please try another", vbExclamation, "Invalid data"
End If
DataGrid1.Columns("Price") = txtTest.Text
If Not IsNumeric(Me.txtTest.Text) Then
MsgBox "Please enter a valid value for Quantity", vbExclamation, "Missing Quantity"
Exit Sub
End If
Dim cPrice As Currency
cPrice = DataGrid1.Columns("Price")
'updating the price table
Dim updateSQL As String
updateSQL = "Update Price set price = " & cPrice & " " & _
" where PriceCode = '" & strPriceCode & "' " & _
" AND ProductCode = '" & strProductCode & "'"
Set RS = Conn.Execute(updateSQL)
.MoveNext
Loop
End With
to (attempt to!) explain the above code, i am saving 1 column of a datagrid, and looping through it by means of the Recordset that it is bound to at run time. However, i want to ensure that the value entered at each record is a numberic value, so it has to be included in the loop as can be seen above. However, when i try to run it ( and enter a non-numeric value to test it) i get the following error " Multiple step operation generated errors - check each status value"....is there anything i can do to fix this? if you need any additional information, please let me know! Thanks in advance!
|
|
|
|
|
im new to programming...
but couldn't you use the IsNumeric() function, if u get true back, just convert it to whichever type u need? CInt, CSng, CDec...etc.
Sorry if i don't know what i'm talking about
______________________________________________
"I'm not me when I dream...anymore." -TRUSTcompany
|
|
|
|
|
Hi,
I want to display a MDI form form ActiveX control. Do U have any idea how to do that? I know it's possible in VB.NET but I want to do it in VB.6.0
Uttam
Regards;
Uttam Kumar
|
|
|
|
|
I have looked into all the crazy ways of doing this and the best that I can find is to create your 'MDI Form' as a usercontrol, then load it onto a real MDI Child form in the parrent application.
The only other thing that you will need to figure out is how to build and destroy menus on the child form if you need them.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
Hi,
Thanks a lot for the help but I'm bit lost can U plz send me a sample code?
Lot of thanks in advance.
Uttam
Regards;
Uttam Kumar
|
|
|
|