|
Hi all,
anyone knows if can convert a pdf page to image?
if so, where can i find examples? or anybody can tell me how.
thanks, an happy Xmas from Spain...
|
|
|
|
|
I have a web page, where after the users enters the data, they should be able to go back and modify data on all the pages. I am using ASP and VBSCript. I am using session variables and getting all the data, into the controls for modifying, but there is a page, which it has a radio button "yes" and "no", if you click yes, it shows more controls.
now, my question is when they come back to modify data and if the session values is yes, it is checked yes, but how shall I show the other controls without clicking on the radio buttons, or how to call the click event within the VBScript.
I need to call the "show('hideable1') method from VBScript if, the session value is yes....
Thanx,
abhi
example code....
onClick="show('hideable1')" name="radio_aspiration" value="yes" '<%if Session("rdaspiration") = "yes" then %>' checked '<%end if%>'> yes
' checked '<%end if%>'> no
abhi
|
|
|
|
|
I would do something like this:
<script>
window.onload = LoadDefaults(<% Session("rdaspiration") %>);
</script>
<script>
function LoadDefaults(rdaspiration)
{
if (rdaspiration == "yes" ) { show("hideable1") }
else {show("hideable2") }
}
</script>
I think something like that should work. I didn't try it in a browser so the syntax may not be correct but the general idea should work.
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
I wantto override Textbox class for date entry.
Format is gg.mm.yyyy
I wrote code below, but user enters 3. number for month, cursor goes to begining of the date.
what do u offer me. (I CANT USE MASKEDTEXTBOX, because clients use Windows ME)
Private Sub DateTimeExtended_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress<br />
Dim asciiInteger As Integer = Asc(e.KeyChar)<br />
Select Case asciiInteger<br />
Case 48 To 57 'Sayi<br />
select case me.text.length<br />
case 2: me.text &= "."<br />
case 5: me.text &= "."<br />
end select<br />
e.Handled = False<br />
Case 8 'Backspace<br />
e.Handled = False<br />
Case Else<br />
e.Handled = True<br />
End Select<br />
End Sub
|
|
|
|
|
You need to set the cursor back to the end of the string. You can do that with the following line:
DateTimeExtended.SelectionStart = me.text.length
However, this would still cause problems, for instance, if the length is 5, and you go back and change character 2. You need more length checking. Try the following code:
Private Sub DateTimeExtended_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress<br />
Dim asciiInteger As Integer = Asc(e.KeyChar)<br />
Dim currentPosition As Integer<br />
Select Case asciiInteger<br />
Case 48 To 57 'Sayi<br />
currentPosition = Me.SelectionStart<br />
If currentPosition = Me.Text.Length Then<br />
Select Case Me.Text.Length<br />
Case 2<br />
Me.Text &= "."<br />
currentPosition = currentPosition + 1<br />
Case 5<br />
Me.Text &= "."<br />
currentPosition = currentPosition + 1<br />
End Select<br />
End If<br />
Me.SelectionStart = currentPosition<br />
e.Handled = False<br />
Case 8 'Backspace<br />
e.Handled = False<br />
Case Else<br />
e.Handled = True<br />
End Select<br />
e.Handled = False<br />
Case 8 'Backspace<br />
e.Handled = False<br />
Case Else<br />
e.Handled = True<br />
End Select<br />
End Sub
Roy.
|
|
|
|
|
Please note that this still doesn't format dates if you are pasting data into the control.
The more conditions you try to cover, the more complex your code will be.
Good luck.
Roy.
|
|
|
|
|
Instead of trying to anticipate all possible keystrokes that the user may press in the date textbox, I prefer to wait until the user is done and presses OK before validating the date. I let the user enter whatever they want and then edit the complete textbox contents. Here are two generic date textbox tests that I normally apply in my data editing procedure.
'** A date is required
If txtDate.TextLength <= 0 Then
MsgBox("A date is required")
txtDate.Focus()
Exit Sub
End If
'** The date must be a valid date
If IsDate(txtDate.Text) Then
'** Ensure the date is complete and properly formatted
txtDate.Text = CDate(txtDate.Text).ToShortDateString
Else
MsgBox("The date is not valid")
txtDate.Focus()
Exit Sub
End If
Another advantage of this code is that it uses the Windows region settings, so you don't have to be concerned with formatting the date correctly for the user.
Do or not do. There is no try.
|
|
|
|
|
I want to know how can i check whether certain key value exist in registry while using Visual Studio 2003 IDE for a Setup Wizard.
I want to do this programmatically.
Regards,
Asim
|
|
|
|
|
Imports Microsoft.Win32
Public Function ReadRegKeyValue(ByVal KeyName As String, _
ByVal ValueName As String) As String
' Read the value of an existing registry key
' Pass: KeyName Name or path of the registry key for which the
' value is being read
' Return: String The sub key value (zero length string if the
' sub key does not exist)
' Create an instance of the RegistryKey class from the Microsoft.Win32 namespace
Dim RegObject As RegistryKey
Dim RegKeyValue As String
' Retrieve the sub key value
Try
RegObject = Registry.LocalMachine.OpenSubKey(KeyName, False)
RegKeyValue = CType(RegObject.GetValue(ValueName, ""), String)
RegObject.Close()
Catch
RegKeyValue = ""
End Try
Return RegKeyValue
End Function
Do or not do. There is no try.
|
|
|
|
|
If you are doing this in a custom action, then I recommend the previous poster's answer.
If you are doing this to check for the existence of a key and want to know its value, then perform the following steps:
- Right click on your setup project in the Solution Explorer
- Choose View > Launch Conditions from the context menu
- Right click on "Search Target Machine" in the Launch Conditions window
- Choose "Add Registry Search"
- Name the new item and fill out its properties in the Properties viewer
Now that property that you've created for the value of the registry key will hold the value that you sought.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Thank you Curtis.
Yes, this is what i was interested in.
The other post was just about registry action using vb.net and not about what i asked!
Regards,
Asim
|
|
|
|
|
Asim,
Glad to help. Happy coding!
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I used to use ConnectNetworkDrive in VB6. Is there a way to do that in VB.NET?
TIA
|
|
|
|
|
ConnectNetworkDrive is not part of VB6, not is it a function in the Win32 API. Where did this function come from? If you can get that code, you can translate it to equivilent code in VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hellow t all ..
i am trying to clean a combobox from the selection ,
i use the combobox.selectedvalue = -1
it clear the combobox but still return to me the selectedvalue as -1
thx for anyhelp
|
|
|
|
|
try to use combobox.selectedindex = -1 instead of combobox.selectedvalue = -1
Thats it. If it don't clear then use the same twice!
Regards,
Asim
|
|
|
|
|
i had tryied it it wont work !
selectedindex - 1 pick the item befor the one that i had picked
|
|
|
|
|
I said : combobox.selectedindex = -1 and not combobox.selectedindex -1 !
Try the above thing and it would work!
Regards,
Asim
|
|
|
|
|
Hi,
I need some help. How can I verify if an object has no instance.
I need to know if my object is nothing, to prevent the object null reference exception.
Thanks in advanced.
biglewy
|
|
|
|
|
try to use :
if not OBJECT is nothing then
// Code here...
end if
Regards,
Asim
|
|
|
|
|
Hai Guys,
i want to check the existance of a table in specific database.
now i am using it as
Dim Rs As ADODB.Recordset
Set Rs = New ADODB.Recordset
Rs.Open "Select * From Employee"
if the Table not Found it give me error
but i think there is another way of checking it so can any one help me...
Sasmi
|
|
|
|
|
Hi Sasmi
use the database in which u want to check the table
then write this query
select name from sysobjects where type='u' and name =<table name>
type ='u' means user table
this will help
abhinav
|
|
|
|
|
Hi all !
I am 2 oracle Server !
In Oracle A, I create a store procedure using dblink to Oracle B to query data.
I buil a application in VB.net. And connect to Oracle A anh use this Procedure but I allway the error:
"database Client not begin transaction"
Athought , I add transaction but this error still occur
Pls, help me, bug it !
Thank alot !
|
|
|
|
|
I'm trying to write a program out of a book called network programming in.net and currently on page 360 13.3.2 using packetX and winPCap
the language I am writing in would be Vb.net I have written this program once before and got help off this site but at that time the individual that helped me told me that perhaps this book was too advanced for me at the time and I agreed so I put it away for well not have went back through the book have gotten to this particular page number and this is the first error that I have run across because of my understanding of it where the first time I went through the book I was coming to this site with questions about every program I was writing out of this book anyway to move on I need help
I've written the code and I have no errors But the program does not work
-----------------------------------------------------------------------------
Option Strict Off
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
With lvPackets
.Columns.Add("From", .Width / 3, HorizontalAlignment.Left)
.Columns.Add("To", .Width / 3, HorizontalAlignment.Left)
.Columns.Add("Size", .Width / 3, HorizontalAlignment.Left)
.View = View.Details
End With
End Sub
Private Sub btnstart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnstart.Click
Me.AxPacketXCtrl1.Start()
End Sub
Private Sub axPacketXCrl1_onPacket(ByVal eventSender _
As System.Object, ByVal e As _
AxPacketXLib._IPktXPacketXCtrlEvents_OnPacketEvent) _
Handles AxPacketXCtrl1.OnPacket
Dim I As Short
Dim thispacket As String
Dim sourceip As String
Dim Destip As String
Dim item As New ListViewItem
thispacket = ""
For I = 0 To e.pPacket.DataSize - 1
thispacket = thispacket & Chr(e.pPacket.Data(I))
Next
If e.pPacket.Data(14) = 69 And e.pPacket.Data(23) = 6 Then
sourceip = e.pPacket.Data(26) & "." & _
e.pPacket.Data(27) & "." & + _
e.pPacket.Data(28) & "." & + _
e.pPacket.Data(29)
Destip = e.pPacket.Data(30) & "." & _
e.pPacket.Data(31) & "." & + _
e.pPacket.Data(32) & "." & + _
e.pPacket.Data(33)
item.SubItems(0).Text = sourceip
item.SubItems.Add(Destip)
item.SubItems.Add(e.pPacket.DataSize)
lvPackets.Items.Add(item)
End If
End Sub
End Class
-----------------------------------------------------------------------------
after the dim statements where the code looks like this me
thispacket = ""
For I = 0 To e.pPacket.DataSize - 1
thispacket = thispacket & Chr(e.pPacket.Data(I))
where it says chr(e.pPacket.Data(I))
in the book it is different it goes like this
thispacket = ""
For I = 0 To e.pPacket.DataSize - 1
thispacket = thispacket & Chr(eventArgs.pPacket.Data(I))
and does not work I can not remember who person was that helped me from this site but there was something else I added a reference and do we changed in the eventArgs. To what is now in the code I think I hope this isn't more confusing than it is helpful I will stop for now until I have a question or if I get a question
-- modified at 22:08 Thursday 8th December, 2005
|
|
|
|
|
Hi, everyone, thanks for viewing my post. I have a custom combobox that allows the user to type within the list and filter the options as the user types letters, and the combobox also allows the user to select a value from the list. The issue I am having is that I need to be able to either return -1 for the selected index if the user types a value that does not exist in the list, or return the selected value if the user selects a value from the list.
Code:
Private comb_companyName_SelectedIndexTextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles comb_companyName.SelectedIndexChanged, comb_companyName.TextChanged
Call Me.ucIMediator.addressCheckStatus()
If Me.comb_companyName.SelectedIndex >= 0 Then
Me.tcmediator.p_cId = Me.comb_companyName.SelectedValue
Else
Me.tcmediator.p_cId = Me.comb_companyName.SelectedIndex
End If
Me.lbl_companyInfoStatus.Text = Me.tcmediator.p_cId
Call Me.enableUserControls(False)
End Sub
The problem with this function is that it fires the two events everytime the index and text are changed. (Meaning I am calling the addressCheckStatus function twice, everytime the user selects one item from the list or types one character into the text area). Does anyone have any idea on how I can control this so that the event will only fire once. Thank you.
eatwork
|
|
|
|