|
I would suspect that is because they are browser plug-ins that can interface with all data the browser sees.
You are talking about a web page reading another web page DOM.
[editing now i have re-read your post again to undetstand the problem more!]
Can you read the source attribute of the iframe? if so why not read that directly and access the source data directly?
modified on Tuesday, June 9, 2009 9:59 AM
|
|
|
|
|
You Know any possible solution?
|
|
|
|
|
Hello friends,
I tried converting lower case char to upper case and vice versa
it works fine with the following code
Dim abc As String
Dim xyz As String = String.Empty
Dim a As Char
Console.WriteLine("Enter The String")
abc = Console.ReadLine()
For Each a In abc
Dim b As Char
If Asc(a) > 64 And Asc(a) < 91 Then
b = Chr(Asc(a) + 32)
ElseIf Asc(a) > 96 And Asc(a) < 123 Then
b = Chr(Asc(a) - 32)
End If
xyz = xyz + b
Next
Console.WriteLine(xyz)
Console.ReadLine()
case 1 Input : ABCdef
Output: abcDEF
case 2 Input :ABC def GHI
Output:abccDEFFFghi
Desired Output:abc DEF ghi
The issue is maintaining the whitespace between the strings, with the current code the the whitespaces are replaced by the previous charcter in the output.
I like the whitespaces between the strings to be maintained .
Thanks In Advance
Praveen
|
|
|
|
|
Member 4514218 wrote: If Asc(a) > 64 And Asc(a) < 91 Then
b = Chr(Asc(a) + 32)
What an ugly, ugly mess. Char.IsAlpha is what you need, from memory. And Char.ToLower.
How about abc = abc.ToLower()
Member 4514218 wrote: If Asc(a) > 64 And Asc(a) < 91 Then
b = Chr(Asc(a) + 32)
ElseIf Asc(a) > 96 And Asc(a) < 123 Then
b = Chr(Asc(a) - 32)
End If
xyz = xyz + b
The core flaw in your logic is that you need another else.
else
b = a
Otherwise, anyting that is not a lower or uppercase character, is lost.
you look like you're coming from VB6, that's where all the nasty habits are coming from. Forget VB6, learn to use VB.NET properly. And, learn to use the debugger, if you stepped through this code, you'd have seen in no time what the issue was.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
very simple...just add one 'Else'... as below...!
Dim abc As String
Dim xyz As String = String.Empty
Dim a As Char
Console.WriteLine("Enter The String")
abc = Console.ReadLine()
For Each a In abc
Dim b As Char
If Asc(a) > 64 And Asc(a) < 91 Then
b = Chr(Asc(a) + 32)
ElseIf Asc(a) > 96 And Asc(a) < 123 Then
b = Chr(Asc(a) - 32)
Else
b = a
End If
xyz = xyz + b
Next
Console.WriteLine(xyz)
Console.ReadLine()
Enjoy!
|
|
|
|
|
Thanks binjafar
It is simple and effective
Regards
Praveen
|
|
|
|
|
my pleasure....
|
|
|
|
|
Dim ca As Char() = TextBox1.Text.ToCharArray
TextBox1.Text = ""
For Each c As String In ca
Select Case Char.IsUpper(c)
Case True
TextBox1Text &= c.ToLower
Case False
TextBox1.Text &= c.ToUpper
Case Else
TextBox1.Text &= c
End Select
Next
My advice is free, and you may get what you paid for.
|
|
|
|
|
Member 4514218 wrote: Dim b As Char
replace this by Dim b As Char = a
the logic is: output char equals input char, except when it is an upper/lowercase letter.
And please use PRE tags to keep code readable.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
What code can I use to read the column and row position of the blinking cursor-thing in a multiline textbox? I am trying to replicate the bottom right corner of windows notepad when you have status bar visible, by default it usually says: "Ln 0, Col 0"
|
|
|
|
|
I'm not sure you can do it directly. Use the Lines property and iterate through until you find the current line based on the current Selection. You might need to take into account the CRLF at the end of each line.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Yes i sort of see how that would work something like:
line = textbox.Text.IndexOf(vbCrlf).compareto 'something
column = textbox.Lines.Length '.something / something
not sure how to go about it though it does seem possible
|
|
|
|
|
err no, Lines gives you an array of all the liens in the control, something along the lines of:
position = textbox.SelectionStart
line = 0
while (position > textbox.Lines[line].Lenth
position = position - textbox.Lines[line].Lenth
line = line + 1
Loop
col = position
Note: this has not been tested.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hey thanks that really helped.
column is still wrong though.
also when the textbox.SelectionStart is on the last line, it causes an out of range error, other than that it works great.
|
|
|
|
|
look at adding the extra characters for the end of line.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hi,
i've made a control which is supposed to drop down on button click. it works perfect if i place it out of table layout, but if i drag drop it in a form with table layout panel... drop down doesnt show...
possibly because of control's parent? OR z-order?
any help will be appriciated....
thnx!
|
|
|
|
|
I believe that the control is bound to its own 'cell' in the TableLayoutPanel. To test that, why not try dropping in a ComboBox, and see if that works properly?
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.”
|
|
|
|
|
Yes sure! every other control works normal if dropped on the table except for the custom made one.
Question is... why doest it works well if dropped on a form ... but once you bring it inside a TableLayout... it does'nt!!
my control uses TextBox, Button and a CheckedListBox that is shown on button click... all these items are inside a TableLayout whose Dock is set to fill and rows are set to Autosize.
i've tried to '.BringToFront()' and things like that but no use...
if it is bound to its own cell as u say... what to do next??? re-design without TableLayOut?? ahh...headache!!
|
|
|
|
|
If other dropdown type controls work correctly then the problem must lie in the way you have implemented the dropdown part of your control. I would suggest that you look for examples of combobox usercontrols, i.e. ones that do not inherit from ComboBox, to see how they do it.
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.”
|
|
|
|
|
This is sunil. I used ntgraph activeXcontrol in vb 6.0 project. i am facing few problems that all are described below:
1.How to set time on x-axis.
2. How to set zoom and unzoom.
If you can give any light on the above problems i will be thankful to u .
Waiting for your reply .
Thanking you ,
Sunil kumar.p
|
|
|
|
|
You should be asking this question here[^].
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Good day to all
I have this problem with the code below; I want the system to simply write what it hears with out using the grammar. is there any way to do that?
I've tried removing the grammar file but it did not work.
any help or suggestions
'Default Imports
Imports System
Imports System.Data
Imports System.Deployment
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Xml
'Custom Imports
Imports SpeechLib
Public Class Form1
'Declares
Dim WithEvents RecoContext As SpSharedRecoContext 'The Main Recognition Object Used throughout the whole program. -- Shared Object: More Info on this later.
Dim Grammar As ISpeechRecoGrammar 'The Grammar Object so the program knows what is going on. -- Instanced Object: More Info on this later.
Dim CharCount As Integer 'This is used to count the amount of chars that are in the text box.
''''Subs Start Here
'Start Button. This will engage reco, and start the entire process.
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
'First check to see if reco has been loaded before. If not lets load it.
If (RecoContext Is Nothing) Then
RecoContext = New SpSharedRecoContextClass 'Create a new Reco Context Class
Grammar = RecoContext.CreateGrammar(1) 'Setup the Grammar
Grammar.DictationLoad() 'Load the Grammar
End If
lblStatus.Text = "Recognition Started" 'Change the Label to let the user know whats up
Grammar.DictationSetState(SpeechRuleState.SGDSActive) 'Turns on the Recognition. This is Vitally important
'This is so the user doesn't break the program by
'trying to start the recognition after its already started.
btnStart.Enabled = False
btnStop.Enabled = True
End Sub
''''
'Stop Button. This will stop stop the recoginition
Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
Grammar.DictationSetState(SpeechRuleState.SGDSInactive) 'Turns off the Recognition. It will go dormant.
lblStatus.Text = "Recognition Stopped" 'Change the label to let the user know whats up
'Again This is so the user doesn't go breaking things accidently
btnStart.Enabled = True
btnStop.Enabled = False
End Sub
''''
'This is the hypothesis sub. The hypothesis is not the final recognition. This will fire many times per word. You do not want to print anything that is final from the hypothesis.
'This is not required for the final recognition. But it is vital to understand it.
Private Sub OnHypo(ByVal StreamNumber As Integer, ByVal StreamPosition As Object, ByVal Result As ISpeechRecoResult) Handles RecoContext.Hypothesis
btnStop.Enabled = False 'Don't allow the user to stop the recognition until it has completed.
'The button will re-enable in the OnReco Event
'This is so you don't kepp printing the same text over and over. It could take up just a tiny bit more processor power
'Its good to not do un-needed things.
If lblStatus.Text <> "Receiving" Then
lblStatus.Text = "Receiving"
End If
End Sub
''''
'This sub is fired when the reco engine detects a set of words. This is what you want to use to print or sendkey.
'Use this sub for the final printing of words.
Private Sub OnReco(ByVal StreamNumber As Integer, ByVal StreamPosition As Object, ByVal RecognitionType As SpeechRecognitionType, ByVal Result As ISpeechRecoResult) Handles RecoContext.Recognition
Dim recoResult As String = Result.PhraseInfo.GetText 'Create a new string, and assign the recognized text to it.
'This block will print to the textbox built into the program
'If you would prefer to use the SendKeys method, Comment out this entire block. And Uncomment the SendKeys Line.
txtBox.SelectionStart = CharCount
txtBox.SelectedText = recoResult & " "
CharCount = CharCount + 1 + Len(recoResult)
'Uncomment the next line if you want to send the text to the selected window rather than constrain it to the textbox.
'SendKeys.Send(recoResult & " ") 'This line sends the result via SendKeys to the top window.
lblStatus.Text = "Finished Dictating"
btnStop.Enabled = True
End Sub
End Class
|
|
|
|
|
If you don't want grammar, could you not simply have each line of text saved into a variable, then remove any grammatical items from that variable before outputting it to your textbox (or wherever it is going to)?
|
|
|
|
|
firstly thnx
O tried to do what u suggested but
it did not work;
it keeps writing the english word that have a meaning.
|
|
|
|
|
My vb form contains an ocx control and I have Form_Initialize method working. Upon executing what will happen
1- Ocx registration is checked before form initialize method??
2- After initialized method??
3- Ocx registration is checked by windows?
please reply.
|
|
|
|