|
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.
|
|
|
|
|
The registration is not checked at all until you attempt to make an instance of your control.
|
|
|
|
|
Thank you for reply.
I have ocx control on my form at design time.
Now I call form_initialize method but get dependency error from windows.
Steps I do.
1- A registered ocx control on VB Form.
2- Make an exe of my program.
3- Un-register the control using regsvr32 -u <control ocx="" path="">
4- Now if i run exe I get dependency error.
I want to handle that error. Please tell.
Thank you.
|
|
|
|
|
vhassan wrote: I want to handle that error. Please tell.
I assume the point of this is to try to work out if you have your control registered, and give an intelligent error message ? Your best bet is to handle the specific exception type, catch it, and show an error message, and exit.
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
|
|
|
|
|
Not under VB6. You only get the On Error Resume Next thing, which sucks.
|
|
|
|
|
I'll say it again. You can't. The error is thrown before any of your code runs.
|
|
|
|
|
hi.
my application's main form is dependent on a control ocx. I want to handle the exception if ocx is not registered on machine if user has no privileges to registered it.
please tell me how can i do that.
Thanks
modified on Monday, June 8, 2009 8:46 AM
|
|
|
|
|
The best you've got in VB6 is to use On Error Resume Next before the code that creates an instance of the object. If you're just using the designer and dropping the contorl on the form, you've got no options but to remove the object from the form and create it manually in your code, just after the On Error line. Right after the line of code you use to create the object, you can check the value of Err.Number If it's non-zero, something went wrong.
|
|
|
|
|
Hello every one,
I am working with VB 2005 application.
I have to create a brush with the background color of a label already displayed on screen.
Depending on options selected by the user the background color of label changes. I want to create the brush of that background color.
Can any one plz help me out with it.
Regards
Nishkarsh
|
|
|
|
|
Dim b As Brush = New SolidBrush(Label1.BackColor)
|
|
|
|
|
|
why would you want to remove it? I rather hide it YourDomainUpDown.Visible = False
Regards: Didi
|
|
|
|
|
Didi, Thanks for the falsifying visible code. I want to remove it because a few domainupdown controls may not be filled with values at runtime. I want to do away with these controls alone which do not contain any values. Can they be removed ?
|
|
|
|
|
...you have got your answer, see post of Johan Hakkesteegt below.
Good luck: Didi
|
|
|
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
For Each c As Control In Me.Controls
If TypeOf c Is TextBox Then
If c.Text.Length = 0 Then c.Dispose()
End If
Next
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Instead of checking for checkboxes you can also check for domainupdown, and any control.
In this example code, you can check what other options you can find behind c, if you want to apply some other logic.
My advice is free, and you may get what you paid for.
|
|
|
|