|
I think you still get the flicker when you resume.
Be sure this is not when you close a dialog, 1.0 and 1.1 (and it may still be there) had a dramatic flicker if you use the DialogResult to manage the closing of a dialog, always explicitly close a dialog.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
A few suggestions:
- Only do paint routines in the proper painting events (OnPaint). Do not alter the painting in mouse events or any other events.
- Use the SetStyle of custom controls to allow for DoubleBuffering/more precise painting control/paint event mapping. DoubleBuffering is a key in reducing flickering.
- This sort of ties with my first point, but be sure that your logic is separate from your actual painting. One of my articles Basics of Falling Blocks in VB 2005[^] has helped many people reduce flickering in their programs because of the painting concepts discussed.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
I hope someone can guide me a bit. I wrote a pice of code that send data over the serial port to a servo controller. here is a piece that matters the most
Private Sub trackBarMiniSSC_Scroll(ByVal sender As Object, ByVal e As EventArgs) Handles trackBarMiniSSC.Scroll
Dim servo As Integer = Convert.ToInt32(trackBarMiniSSC.Value)
Dim baudRate As Integer = Convert.ToInt32(comboBoxBaudRate.Text)
Dim comPort As String = comboBoxCOMPort.Text
serialPort1.MiniSSC(comPort, baudRate, 0 , servo)
serialPort1.MiniSSC(comPort, baudRate, 1, servo)
End Sub
-----------
as you can seethis send my track bar's value to the serial servo controller and moves my servo in location 0. (8 channel controller) I also want it to send the same data to location 1 as well at the same time. Am I doing it right by writing 2 lines?? Or there's an easier (faster) way of doing it. unfortunatelly the project is very speed sensitive.
Thanx
|
|
|
|
|
Since no one has replied, I'll make a guess... Since the com port can only send one command at a time, that's the fastest it can be sent. Even if you put the send statements in their own threads to execute concurrently, only one command can be sent out the port at once.
Now if someone out there knows better and can straighten me out, please do!
|
|
|
|
|
I am working on making a specialized custom control that contains 3 other controls in it.
One of the Fields is a group box. I have set it up so that the user can set what the group box text property says however every time you run the application the control is in it reverts to the text that is in the group box instead of what the user typed in.
The property i use to get the text in the application is as follows.
<browsableattribute(true)> _<br />
Public Shadows Property Text() As String<br />
Get<br />
Return gbContainer.Text<br />
End Get<br />
Set(ByVal value As String)<br />
gbContainer.Text = value<br />
End Set<br />
End Property
The value in the group box text is ""
Has anyone found a solution for this?
|
|
|
|
|
You are obviously not storing/restoring the user input between sessions. Were you under the impression when you changed to text it was stored somewhere, possibly the compiled exe maybe.
You can either use the project settings with a user scope and let the system store it in the config table or create your own settings.xml and store user settings there. When you open the form you need to go to the settings store and get the group box text.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi
I am displaying locations on dropdownlist so the problem is if i have selected record which is not in the database it gives me this error" 'ddlLocation' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value "
here is my code and is working perfect if the record is in the database
If strPerNo = "" Then
Session("samacc") = HttpContext.Current.User.Identity.Name.ToLower
emp = cEmp.GetEmp(Session("samacc"))
'empPhoto = cEmp.DisplayPhoto(emp.perno)
Else
emp = cEmp.GetEmpByPerNo(strPerNo)
'btnAdmin.Text = "UPDATE"
End If
If emp.perno = "" Then
Response.Write(Session("samacc") + " not found")
Else
Session("perno") = emp.perno
Response.Write(emp.name + " " + emp.surname)
Session("ImgPerNr") = emp.perno
txtFirstname.Text = emp.name
txtLastname.Text = emp.surname
txtDivision.Text = emp.BsUnit
lblBU.Text = emp.BsUnit
txtBlock.Text = emp.block
txtFloor.Text = emp.floorno
txtRoom.Text = emp.roomno
txtInt.Text = emp.Int1
txtTel.Text = emp.tel
txtAltTelNo.Text = emp.alttel
txtCell.Text = emp.cellno
txtAltCell.Text = emp.altcellno
txtEmail.Text = emp.email
txtFax.Text = emp.fax
txtAltEmail.Text = emp.altemail
If ddlLocation.SelectedValue <> "0" Then
ddlLocation.SelectedValue = emp.LocID
Else
ddlLocation.SelectedValue = 0
End If
Mamphekgo
|
|
|
|
|
mamphekgojakes wrote: ddlLocation.SelectedValue = emp.LocID
Does the value of emp.LocID exist in the Drop down. You get such an error when you set the selectedvallue to a value that doesnt exist in the Drop down item collection
|
|
|
|
|
if the value does exist how can assign 0 to non existing values
Mamphekgo
|
|
|
|
|
you add like a "Select One" Item to the drop down list with a value of 0, and then you set the selected value to 0 if the item dont exist. So you have to loop the dropdown to check if the value you are setting exist or not.
|
|
|
|
|
Hi,
Please tell me How to send Email reminder automatically by fetching data from Excel sheet in VB.NET ?
Thanks in advance.
G Singh
|
|
|
|
|
guriqbal87 wrote: Hi,
Please tell me How to send Email reminder automatically by fetching data from Excel sheet in VB.NET ?
Thanks in advance.
What have you tried so far? Where are you stuck?
|
|
|
|
|
Hi,
I am able to fetch data from excel sheet.
actually thing is that in the excel sheet,there are some scheudeled tasks for each person,and I want that application send a reminder to that person in one day advance,if there is any task for that person.
Please help me ,hw I can do it in VB.NET?
G Singh
|
|
|
|
|
If you are able to get the data from the exel spreadsheet then the hardest part is already done. Are you able to manipulate the data that you returned? Or are you assuming you have all the data and can't verify it is returned? Their are a few articles on this site on how to send the actual emails, and if you are able to manipulate the data you got from the excel spreadsheet then that will just be a few conditional statements.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Hi all,
I want to embed flash players object in my windows application for playing .flv files. I have used ShockwaveFlashObject, But i am not able to play .flv files.
anybody know the solution???
Pravin
|
|
|
|
|
Embed a webbrowser control into your application and then navigate to a page displaying the flv player.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
thanks but i want to play local file.
Pravin
|
|
|
|
|
I have a start button, pause button and end button.when user clicks on start button the timer should start, when they press pause button,
timer should pause and should able to store the elapsed time in terms of minutes...later again if the user press the resume button (the same
pause button) the timer should continue from the elapsed time..finally after clicking end button the total duration of the elapsed time (before
pause and after resume click events) in minutes should get stored in access database field..
I need to do this in vb.net 2003 with access database 2003...
thanks a lot for ur valuable suggestion....
regards
chandru
|
|
|
|
|
I guess its very simple. You should take a variable to save the time during which timer is running. whenever user clicks start it should start the timer from zero and when he stops it you just take the difference using TimeSpan object and add it to the variable you are using for saving the time.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
There are couple of ways to do this:
(1) Use the timer object (this is very simple)
(2) Use the DateTime class.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
Use the StopWatch class. Use the Start and Stop methods to control it and the Elapsed property to get the total time.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
* I need help in learning how to set grammar in SAPI 5.1 to perform Voice command
The code I have is able to do dictation, now I just wanted to expand to do voice command with a preset XML grammar.
Please help up
Sample code will helps too. - boyzwong@gmail.com
Thank you
'Default Imports
Imports System
Imports System.Data
Imports System.Deployment
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Xml
Imports SpeechLib.SpeechGrammarWordType
'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
If (RecoContext Is Nothing) Then
RecoContext = New SpSharedRecoContextClass 'Create a new Reco Context Class
Grammar = RecoContext.CreateGrammar 'Setup the Grammar
'Grammar.DictationLoad() 'Load the Grammar
Grammar.CmdLoadFromFile("c:\gram.xml", SpeechLib.SpeechLoadOption.SLODynamic)
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)
If txtbox.Text.Contains("testing") Then
Beep()
End If
'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
XML
<!-- Language ID = British English -->
<GRAMMAR LANGID="413" LEXDELIMITER="|" WORDTYPE="LEXICAL">
<RULE NAME="HelloWorld" TOPLEVEL="ACTIVE">
<!-- when the user says the following pronunciation, "Hiya" will be displayed -->
<P>Hello World</P>
</RULE>
</GRAMMAR>
modified on Thursday, July 31, 2008 5:57 PM
|
|
|
|
|
cw342cw wrote: Sample code will helps too. - boyzwong@gmail.com
Not a good idea to put email address in the post. You open yourself up to spammers. There is an email link at the bottom of the post that people may use if they really want to send you an email.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi all,
I am trying to assign image to unknown control as follows.
abcd(ByRef element As System.Windows.Forms.Control)
{
CType(element, PictureBox).Image = frmMain.DefInstance.imlMain("Image1")
}
But, its giving casting error. Please let me know the solution.
Thanks in Advance.
AR Reddy
|
|
|
|
|
if typeof(element)==typeof(PictureBox)
CType(element, PictureBox).Image = frmMain.DefInstance.imlMain("Image1")
else
yadada yadda
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|