|
As Dave said, and you might find the .Contains(String) function of a string useful. Also, because if only one character matches (in your case), you can iterate through each character in a string and see if it matches any character in the given string. Good Luck!
Zaegra
Motivation is the key to software development.
|
|
|
|
|
hi..
i am trying to develop a report using crystal report with ttx using vb.net 2005, in the first stage i created the report with data source as Field Definition Only. problem am facing is that how should i insert values to the ttx file. plz help me out in solving this..
|
|
|
|
|
Greetings !!!
I'm writing an app which has a WebBrowser where I'd like to open things like Word documents, pdf and djvu files etc.
The really BIG thing that I need would be to, say, open a file in the app's WebBrowser on a specific page.
How can I do it? Essentially I need to be able to access the document that is currently opened in MyWebBrowser and set it's page to, say, 4.
Any help would be greatly appreciated.
|
|
|
|
|
I'm not sure that you can. You would do better to use Word directly via the tool for office, instead of putting it in a web browser.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Unfortunately I HAVE to do it via the WebBrowser =(
But I can't seem to figure out how to get at the opened document's parameters. Maybe this info can be foun in WebBrowser.Document after I call WebBrowser.Navigate("C:\file.doc") ?
|
|
|
|
|
I doubt it, that's going to give you a HTML document. I believe that Word is just opening inside the browser as a COM object, so that's probably empty. You realise that the user still needs to have Word installed ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Thank you for your fast and meaningful replies.
Yes I do realise that the user would have to have Word, Adobe Acrobat etc installed in order to open the documents. However, this issue will be dealt with in the program requirements =)
Here's what I've tried to do and the results of my actions:
Bits of code:
Dim doc As HtmlDocument
wb.Navigate("C:\1.doc")
doc = wb.Document
MsgBox(doc.GetElementsByTagName("EMBED").Count.ToString)
And the result returned by msgbox is ZERO !!! So it seems your were right. So I guess I'd need to somehow get inside the MS Word that opens the document inside my WebBrowser and figure out the page that the document is currently on, is that right ?
EDIT: Hmm, MsgBox(doc.Body.InnerText) returns an empty string as well. So methinks the issue is inside the Navigate method and the way it opens documents.
modified on Friday, June 5, 2009 6:14 AM
|
|
|
|
|
Agarwaen59 wrote: So I guess I'd need to somehow get inside the MS Word that opens the document inside my WebBrowser and figure out the page that the document is currently on, is that right ?
It's always good to know what you're talking about when you're defining requirements, so you can tell the client if what they want is possible. Yes, Word is still running, just inside the browser. You may be able to use the Office Tools to access your document ( I confess I've never used them )
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Ok, i'll look into the Office Tools and see what I can do.
However, what should I do if user decides to open a pdf or djvu file on specified page ??? (A: shoot myself ?! )
|
|
|
|
|
Inside the web browser, you have no access to the viewer or the document it's showing. As far as I can find out, you cannot show a specific page.
|
|
|
|
|
hi,
i have one gridview,textbox and button in form
In Db contain Id,Name,Address
when i click the button show all information from db.
its working good.i need sort list the datagrid.
for example i have to enter A in textbox its automatically
sort list A names only(using like query). this also working good.
but already gridview contain 10 records.then added new search result also.
so i need to refresh datagrid n after search text.
thanks in advance
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
You just reset it's datasource to the new data you want to show.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
thanks..
i got solution....
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Try this:
datagridview.Update()
|
|
|
|
|
not working this method..
reset the data set. now perfectly working
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
You might want to read the documentation on what the Update method does.
|
|
|
|
|
Hi,
Can any one help me to get the current user name(RDN) in windows using vb/c#.net
am able to get the user name but i need to get the RDN name
Thanks,
Nanda
|
|
|
|
|
|
I have a wireless device that has a DLL that can be used to control it. I'm trying to utilize VB.Net to control it, but several of the functions in the DLL contain pointers which is proving to be quite the challenge. The following DLL call keeps returning false and I can't figure out why. I have tried changing the values that I pass to the dll from ByRef to ByVal and vice versa as I have found that to work with a few other DLL calls, but not this one. I'm hoping somone can point me in the correct direction.
DLL being called:
BOOL AirpcapWrite ( PAirpcapHandle AdapterHandle,
PCHAR TxPacket,
ULONG PacketLen
)
Transmits a packet.
Parameters:
AdapterHandle Handle to the adapter.
TxPacket Pointer to a buffer that contains the packet to be transmitted.
PacketLen Length of the buffer pointed by the TxPacket argument, in bytes.
Returns:
TRUE on success.
where PAircapHandle is defined as
typedef struct _AirpcapHandle * PAirpcapHandle
The code that I am unable to get to work properly is as follows:
Imports System.Runtime.InteropServices
Public Class Form1
Structure AirpcapDeviceDescription
Dim address As IntPtr
Dim DeviceName As String
Dim DeviceDesciption As String
End Structure
Private Declare Function AirpcapWrite Lib "airpcap.dll" (ByVal AdapterHandle As IntPtr, ByRef TxPacket As String, ByRef PacketLen As Long) As Boolean
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim handle As IntPtr
Dim channel As Long
Dim TxPacket As IntPtr
Dim packetData As String
Dim packetLen As Long
packetData = "FFFFFFFF"
packetLen = Len(packetData)
TxPacket = Marshal.StringToHGlobalAuto(packetData)
'transmit a packet
If AirpcapWrite(handle, packetData, packetLen) = True Then
Debug.Print("succesfully transmitted a packet")
End If
End Sub
End Class
I functioning code where I have been able to obtain the handle.
Thanks for the help!
|
|
|
|
|
Well, BOOL is an int, for a start. A long and a ULONG are not the same thing, you want unsigned long. I think you should check www.pinvoke.net for tips on pinvoke signatures.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hello,
Does anyone know how to convert the KeyCode/KeyValue to an ascii character? I found i could use an api call to do it but I can't call a dll for every keystroke an expect performance...
Problem --> I hit the \ key. Depending on how I try to convert it, i either get "0EM5" or the U with the 2 dots above it. How do i convert the value to ascii 97?
Thanks,
Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Try casting it to an int.
protected override void OnKeyDown(KeyEventArgs e)
{
string str = string.Format("\x202D{0} (0x{1:X4})", e.KeyChar, (int)e.KeyChar);
txtKeyValue.Text = str; <=================== a textbox for visual confirmation, while testing
}
[Edit]
Sorry, that is C#. I forgot I was in VB Forum.
I'll try to translate and get back to you.
[/Edit]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I'll try to do it in VB.Net this time. Be warned I don't use VB very much so there may be the odd error, but I hope to be close enough for you to understand.
Private Sub Panel1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
Dim str As String = String.Format("{0} ({1:X4})", e.KeyCode, CType(e.KeyCode, Int32))
Me.TextBox1.Text = str
End Sub
Hope this helps. I've tested it in VB.Net Express 2005, and it works.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry,
Thanks for the idea. However, I do not get the desired out come. Using the exact line you gave, it outputs 'OEM5' 'DC' it converted the 220 which is the \ to hex instead of the ascii value.
thanks for your effort
nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
I am sometimes extremely thick!
In case you have not solved this yet, search MSDN for the Asc Method .
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|