|
you could search for the "loose focus" event...
otherwise, the textchanged event can work, but you'll have to explain what you really need to do...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi
Sorry i cudn't get what you said.
All i need to do is when i try to enter some data in the textbox, the textchanged event should not be raised until the data input is completely done.
In the Textchanged event i have a function which calculates a value, say X = A + B, where A is taken from the textbox.
Now as the value is a double i need to enter something like 0.18, but the textchanged event is fired even before i complete the data input so A is 0 instead of 0.18.
I am not sure how the lostfocus() event would help in this situation.
Thanks
|
|
|
|
|
prathiba_naresh wrote:
I am not sure how the lostfocus() event would help in this situation.
you are certain the user ended typing into the text box...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Yes, but the problem is thats the last textbox and user won't click on anyother button to raise the lost focus event.
As soon as the user finishes entering the number i need to display the result in another textbox..(In this case the textbox still has focus)
|
|
|
|
|
use Validating Event of textbox
|
|
|
|
|
Solves the problem partially.
Problem is this is the last textbox and user will not remove the focus from this textbox, even the Validating event will fire only if the user clicks anywhere else.
Anyway thanks for your inputs.
|
|
|
|
|
Using the text_changed event is in my opinion no good idea for getting data from user.
As you mentioned, you want the user to ENTER data, so on the last textbox (or even on your form) on the Key_Press event, check for enter key.
So you fill the textboxes and just simply press Enter and everything goes fine.
Hope it helps
|
|
|
|
|
Hi
Thanks for ur help. Will try this.
|
|
|
|
|
Should definatetly use a "Ok", "Submit", "Calculate" button. I can't think of any way for validation to occur unless there is a consistent pattern to the numbers that will be placed in that field. (i.e. between 0.01 and 0.99).
Thanks,
Taen Karth
|
|
|
|
|
Hello!
I want to compress a file for transfer and the decompress later..
How can I do it using vb.net. I have .Net Framework 1.1 installed.
I tried System.IO.Compression namespace but it is for Framework 2.0 therefore cant use it.
Any suggestion...material...
Thanx
_mubashir
|
|
|
|
|
You can use a free library for .NET: SharpZipLib
You can download this library from:
SharpZipLib
And you will need the following code to compress a file:
Public Shared Sub ZipFile(ByVal strFileToZip As String, ByVal EntryName As String, ByVal strZippedFile As String, ByVal nCompressionLevel As Integer, ByVal nBlockSize As Integer)
If (Not System.IO.File.Exists(strFileToZip)) Then
Throw New System.IO.FileNotFoundException("The specified file " + strFileToZip + "could not be found. Zipping aborted.")
End If
Dim strmStreamToZip As System.IO.FileStream
strmStreamToZip = New System.IO.FileStream(strFileToZip, System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim strmZipFile As System.IO.FileStream
strmZipFile = System.IO.File.Create(strZippedFile)
Dim strmZipStream As ZipOutputStream
strmZipStream = New ZipOutputStream(strmZipFile)
Dim myZipEntry As ZipEntry
myZipEntry = New ZipEntry(EntryName)
strmZipStream.PutNextEntry(myZipEntry)
strmZipStream.SetLevel(nCompressionLevel)
Dim abyBuffer(nBlockSize) As Byte
Dim nSize As System.Int32
nSize = strmStreamToZip.Read(abyBuffer, 0, abyBuffer.Length)
strmZipStream.Write(abyBuffer, 0, nSize)
Try
While (nSize < strmStreamToZip.Length)
Dim nSizeRead As Integer
nSizeRead = strmStreamToZip.Read(abyBuffer, 0, abyBuffer.Length)
strmZipStream.Write(abyBuffer, 0, nSizeRead)
nSize = nSize + nSizeRead
End While
Catch Ex As System.Exception
Throw Ex
End Try
strmZipStream.Finish()
strmZipStream.Close()
strmStreamToZip.Close()
End Sub
A tipical call to this method is:
ZipFile("c:\outputfile.zip", "inputfile.txt", "c:\inputfile.txt", 7, 16348)
Regards,
Vidal Gutierrez.
Vidal Gutiérrez Ch.
|
|
|
|
|
Thanx a lot it works.......
_mubashir
|
|
|
|
|
I have made a program Visual Basic .NET witch uses DirectX 8.1. Now I have rewritten this program for DirectX 9.0c, but one thing is not working anymore, because Microsoft has not included Directshow anymore in DirectX 9.0c.
Now let me explain what the problem is. With my program, I can play movies. I can also capture the movie, but I can't grab a frame anymore. This is the problem I encounter.
I have tried many ways to get Directshow in my Visual Basic .NET. I have downloaded a file, directshowlib.dll, and I tried to install the software Platform SDK from Microsoft. The software Platform SDK will not install at my PC, and with the directshowlib.dll I can't solve the problem.
Can anyone send me some information, about what program I need to install on my PC, and what commando's I need to use to get this software to work?
|
|
|
|
|
Hi,
I am searching in MODI API's to convert raw text to Tiff. But I couldnt find anything to do that. I dont know if i have to use printing interface in VB.net to do the same. Can anyone help me please.
Harish
|
|
|
|
|
Hello Everyone,
I have create activeX control in MFC adding one event to that
control having parameter of type VARIANT. but when we use
that control in VB and run that application, it give error
"variable uses an Automation type not supported in Visual Basic"
how can i solve this problem.
Whats diff. between MFC VARIANT and VB variant datatype.
help me..
Thanks in advance
Regards
Rajesh Kapure
|
|
|
|
|
Hi,
I have a datagrid that is databound. One of the fields is a 'date' field(which comes from database). What I need to do is that if the date is current data , i.e. today's date then I need to display an animated image of 'New' sign next to it and it is anything other than today(which is ofcourse past date ) then I need to display animated 'Old' sign image.
I have the images saved in the same directory as the application. I have also created a template column for the Image and a Itemdatabound sub but I do not know th exact method or syantax to include an image file in the Itemdatabound Event.
Any help anyone please?
thanks a ton!
Aartee.
...HE is watching Us All!
|
|
|
|
|
Eureka!!! I got it...
Aartee.
...HE is watching Us All!
|
|
|
|
|
Hi,
I have two windows forms.User opens the first form(form1) and clicks "open" button then a new form opens(form2).
He makes a choice in form2 .I need to add some string to listBox that is on form1 when user clicks button on the form2. Both forms are open at this time.
If i use
"Dim myForm As New Form1"
it makes the change i need but it creates a new form1.
would someone send some syntax for that?
Thanx in advance..
--junior coder--
|
|
|
|
|
You can pass the form1 as reference to form2 and when the user clicks button on form2 set the string in form1's reference.
That is, When displaying form2 from form1 you would say,
Dim form2 as new form2(form1)
In the Form2's constructor(Public Sub New)
say Public Sum New(byref Form1 as form1)
Hope this helps.
|
|
|
|
|
Here is form1 code:
Public myform2 As New form2
I defined form2 as global variable
Here is form2 code when you hit a button:
Dim f1 As New Form1<br />
f1.Show()<br />
f1 = Me.Owner<br />
<br />
f1.textBox1.Text="something else"
But it does not work
here is error message:
An unhandled exception of type 'System.NullReferenceException' occurred in TestForms.exe
Additional information: Object reference not set to an instance of an object.
--junior coder--
|
|
|
|
|
I assume you have a button in form1 to invoke form2.
So put this code in button_click event of the form1 where you call the form2.
Form1 Code
----------
Dim myform2 As New Form2(Me)
myform2.ShowDialog()
In form2
Declare a Variable
Dim prevform As Form1
If you click on the + sign near the Windows Form Designer generated code,You will see the Public Sub New. it should look like this.
Public Sub New(ByRef form1 As Form1)
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
prevform = form1
'Add any initialization after the InitializeComponent() call
End Sub
In the Form2 button_click (where you want to call form1, paste this code.
prevform.TextBox1.Text = "something else"
Me.Hide()
This should work fine.
|
|
|
|
|
thanx it works fine..
--junior coder--
|
|
|
|
|
I have one datagrid for fetch and display the values from the table.
I need to adding items to datagrid at runtime using vb.net.
I want the code.
my code is
Dim con As SqlClient.SqlConnection
Dim Cmd As SqlClient.SqlCommand
Dim da As SqlDataAdapter
Dim ds As New DataSet
Dim constring As String = "data source=ccs10; initial catalog=gcis;user id=jpa;password=jpa"
Private Sub Btn_Raise_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Raise.Click
Dim CoMm As String
con = New SqlClient.SqlConnection(constring)
cmd=new sqlclient.sqlcommend("Select * from Paperrfq")
da = New SqlClient.SqlDataAdapter(cmd)
da.Fill(ds, "paperrfq")
DataGrid1.DataSource = ds.DefaultViewManager
aruljothi
|
|
|
|
|
Can you please be more specific on the nature of your problem? Please tell more about your data fields that you need to display. I am saying this because I do this all the time and maybe I can help you.
Aartee.
...HE is watching Us All!
-- modified at 3:02 Tuesday 30th August, 2005
|
|
|
|
|
hello mam,
Thanks for ur reply.i am a beginner in dotnet.i wud like to know about the data grid functionality.my requirement is i should be able to view the data in the datagrid from the database as well i want to enter new data in the same data grid to update my database.is this possible in vbdotnet and pls help me in getting things right.
I have more datafields in a table and display that in a datagrid.
Datafields are Empno as integer,empname as string
thank u
aruljothi
|
|
|
|