|
try this coding
dim yourstring as string
yourstring = datetime.now
textbox1.text=yourstring
u'll get date n time in required format
|
|
|
|
|
|
Hi i have two html pages...,
In first html page i have some two links like(link1, link2)...,
In another html page i have 8 links like (link1 to link8)...,
If i click in first html page that "Link1", then its want to go second html page and show first 4 links(link1 to link4)...,
in that time that link5 to link8 want to be hide(visible=false)...
Similarly,if i click "Link2" then its want to go second html page and show last 4 links(link5 to link8)...,
in that time that link1 to link4 want to be hide(visible=false)...
How to do this one...,
Plz help me......
Magi
|
|
|
|
|
Why not just pass the 4 hyperlinks to the second page and set them manually when you transfer control to it? You could also do the same with just passing a single value to the second page and setting 4 textboxes with links to the specific values you want to display.
David
|
|
|
|
|
Hi plz send the code...,
I didnt get the answer...,
Plz hlp me...
Magi
|
|
|
|
|
Here's an article with some sample code on how to pass information from one html page to another: http://www.vbdotnetheaven.com/UploadFile/avi_sanjay/ServerTransfer02222007000910AM/ServerTransfer.aspx
You can transfer which link they clicked on from the first page (or make it have two buttons instead or something). Or, even better, why not just have three html pages in this format:
Page 1:
Click Link/Button 1 - Goto page 2
Click Link/Button 2 - Goto page 3
That way you don't have to do anything fancy to make it work.
David
|
|
|
|
|
I want to write an application in vb.net which will accept input only from the keyboard numeric keys. Can anyone pls suggest how do i go about it..
|
|
|
|
|
|
Put this in the forms keydown event, it will block all keys other than the numpad:
If e.KeyCode < Keys.NumPad0 OrElse e.KeyCode > Keys.NumPad9 Then<br />
e.handled = true<br />
End If
This works because all keys are numbered and the numpad keys are numbered consecutively. This statement rejects all keys that don't fit between the 0 and 9 on the numpad. Make sure the forms keypreivew property is set to true.
This will allow top numbers and numpad(I think).
If e.KeyCode < Keys.D0 OrElse e.KeyCode > Keys.D9 Then<br />
e.Handled = True<br />
elseIf e.KeyCode < Keys.NumPad0 OrElse e.KeyCode > Keys.NumPad9 Then<br />
e.Handled = True<br />
End If
Posted by The ANZAC
|
|
|
|
|
Thanks a lot...it was a very useful information
|
|
|
|
|
your welcome.
Posted by The ANZAC
|
|
|
|
|
well u might be using textboxes to enter the values..
lets take two textboxes
so its easy man..
jst have allok at this code...
in keypress event like
Private Sub Text1box_KeyPress(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress, TextBox2.KeyPress<br />
dim keyascii as short= Asc(eventargs.keychar)<br />
select case keyascii<br />
case 48 to 57 ' numeric keys 0 to 9 <br />
case 8 ' backspace<br />
case else ' other keys<br />
keyascii = 0<br />
end select<br />
if keyascii = 0 then <br />
eventargs.handled = true<br />
end if<br />
end sub<code>
|
|
|
|
|
Hi everyone,
I was wondering, what would be the correct way of formatting a number, based on regional settings.
For example:
Dim value as double = 123456.78<br />
Label1.Text = value
The label would show:
123456.78
I need it to show:
123,456.78 if I'm in the UK
123.456,78 if I'm in Europe
I'm sure its a simple Format problem. Just cant remember.
Any ideas
Mark
|
|
|
|
|
Use the format string "N2" to format the number. It will give you the correct format for the current regional settings.
Mark06 wrote: 123,456.78 if I'm in the UK
123.456,78 if I'm in Europe
Last time I checked UK was still part of Europe.
---
single minded; short sighted; long gone;
|
|
|
|
|
But how do I should I use it?
I tried Label1.text = String.Format(value, "N2") and it didnt work.
As for Europe, appologies, I meant countries like Germany represent decimals and thousand seperators differently to UK.
|
|
|
|
|
Tip: "didnt work" is not a very good problem description.
Use it like this:
Label1.text = value.ToString("N2")
or like this:
Label1.text = String.Format("{0:N2}", value)
---
single minded; short sighted; long gone;
|
|
|
|
|
Sir/madam,
I know the deployment process.But the problem is i want my exe get deployed into startup
Please help.
Thanks and Regrds
Pankaj Garg
|
|
|
|
|
There's a start folder in the start menu, you can put a shortcut there. There's also a Run registry key in the Windows sub keys, you can put the path there.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
I've got 2 images, both loaded into pictureboxes.
Now i want to compare them, and if the 2 images match return "True", and if they dont match return "False". I don't want to compare the size etc. but i want to compare the pixels of both images. How can i do this?
Thanks in regard, Zaegra
--Zaegra--
|
|
|
|
|
As you're using VB.NET, you can't access the pixels directly, you'd have to loop over them using GetPixel.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
on my form i had two pictureboxes (picturebox1 & picturebox2 ), both of which had the same image loaded, two labels (label1 & label2 ) and a button (button1 ).
Dim image1 As Bitmap<br />
Dim image2 As Bitmap<br />
Dim v As Integer 'verical position<br />
Dim vt As Integer 'total height<br />
Dim h As Integer 'horizontal position<br />
Dim ht As Integer 'total width<br />
Dim thesame As Boolean = True<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
image1 = PictureBox1.Image<br />
image2 = PictureBox2.Image<br />
v = 0<br />
h = 0<br />
vt = image1.Height<br />
ht = image2.Width<br />
<br />
Application.DoEvents()<br />
<br />
For v = 0 To vt - 1<br />
For h = 0 To ht - 1<br />
If image1.GetPixel(h, v) <> image2.GetPixel(h, v) Then<br />
thesame = False<br />
End If<br />
Me.Label1.Text = h<br />
Application.DoEvents()<br />
Next<br />
Me.Label2.Text = v<br />
Application.DoEvents()<br />
Next<br />
<br />
If thesame = False Then<br />
Me.Text = Me.Text & " False"<br />
Else<br />
Me.Text = Me.Text & " True"<br />
End If<br />
<br />
End Sub
Please note, this pixel by pixel comparison takes a long time, my image was relatively small, 500 x 300, larger images will take much longer. The filling of progress into the textboxes may have slowed the application down, but i used this to confirm it was all working, you can clean this up and do whatever you want with it.
The total width and height must have 1 taken away during comparison, due to the zero based indexing on images.
Also my images were identical in size and i haven't accomodated for variance in size, in this instance this comparator code would be redundant.
Posted by The ANZAC
|
|
|
|
|
Sir/madam,
I was thinking of embeding the command button in the crystal reports 2005.
micosoft did not povide the command button.Can i use the access macros to do this.
in MS access reports i can invoke buttons to the reports.
Please help.
Thanks and regards
Panakj
|
|
|
|
|
Can anyone give me a code for convert PDF to DOC?
Thanks
................
|
|
|
|
|
There is no code to do this with the framework, not in a format that could be posted here, anyhow. You'd have to buy a component to do this.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am invoking wordpad using system.diagnostics.process.start().
Is there a way to hide the toolbars ruler etc while opening wordpad from vb.net.I want all the main menu bar to be dispalyed with the opened file.
|
|
|
|