|
can we pass a value from one windows form to another windows form as we do in asp.net (using session or cookies)..???i m using vb.net...
for ex i have a main form (form_main) in which i enter a id no in a textbox (tbid).when i press the submit button,another form(form_month) will be displayed which will ask for the monthly break up of the amount collected in the form_main. i want to enter the monthly break up amount along with the id (which is present in the form_main in tbid textbox).how can i insert that selected id value (from the form_main ) into the form_month when i will press the submit button of form_month (since form_month doesnt contain the field tbid..so i cant write the tbid.text value in the nsert query if form_month)
i want to save the data of form_main and form_month in 2 different tables with a common attribute id in both table
its urgent...any help in this regard will be highly appreciated..
pradip kishore
|
|
|
|
|
form_month needs to know about form_main
In form_month:-
<br />
Public Class form_month<br />
<br />
Private m_FormMain As form_main<br />
<br />
<br />
Public Sub New(ByRef formMain As form_main)<br />
MyBase.New()<br />
m_FormMain = formMain 'setting a ref to the orig form form_main<br />
<br />
' This call is required by the Windows Form Designer.<br />
InitializeComponent()<br />
<br />
' Add any initialization after the InitializeComponent() call.<br />
<br />
End Sub
In form_main:-
Public Class form_main<br />
Dim m_form_month As New form_month(Me)
in the code for the submit button to open form_month:-
m_form_month.Show()
in the code for the load event for form_month read the value of tbid:-
Private Sub form_month_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
<br />
Dim contentsOftbid As String<br />
contentsOftbid = m_FormMain.tbid.Text
hope this helps
Alex
|
|
|
|
|
That would work, but the problem is you need to make your controls public. Instead, you should expose properties, or use delegates, to hide as much detail of your class as possible.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Alex
thanks a lot for your simple and quick response..
pradip kishore
|
|
|
|
|
|
please help me on.... How can i upload an entire folder?
Feroze
|
|
|
|
|
Not possible in pure HTML. You will have to use som kind of java-applet.
Take a look at http://www.javaatwork.com or search google for "java applet upload"
---------------
http://serverside.no
|
|
|
|
|
sir/madam,
I invoked a control named datagridview in the design form.
Than in the code behind file , i was trying to write
Dim m as new datagridviewmemocolumn
but datagridviewmemocolumn was not there in the list of functions.
Please help.
Thanks and regards
Pankaj
-- modified at 2:36 Monday 15th January, 2007
|
|
|
|
|
hi pankaj,
will tell in detail....why u required datagriviewmemocolumn?
priya
|
|
|
|
|
Good AfterNoon Madam,
My previous problem is solved .I need ur help in an another problem.There is a checkbox style column in the datagridview in vb.net.Now The problem is , I wanted to know whether the checkbox in the first row and first cell is checked or not.I mean , can i programically calculate this.
Thanks and Regards
Pankaj
|
|
|
|
|
yes pankaj,
dim row as integer
dim col as integer
row=1
col=1
If DGTimeSheet.Item(col, row).Value = True Then
MsgBox("selected")
End If
priya
|
|
|
|
|
yes pankaj,
dim row as integer
dim col as integer
row=1
col=1
If DGTimeSheet.Item(col, row).Value = True Then
MsgBox("selected")
End If
priya
priya
|
|
|
|
|
hallo pankaj is ur problem solved?;)
priya
|
|
|
|
|
hi pankaj,
do u know mySql?
priya
|
|
|
|
|
Madam,
Thanks a lot.It is working very fine.
Thank You very much.
and I know Access and SQl Server
I read ur query . u wanted insert , delete , update implementation programically.
may i help u?
Thanks and Regards
Pankaj
pankajgarg10@yahoo.co.in
-- modified at 7:15 Monday 15th January, 2007
|
|
|
|
|
hallo pankaj,
righnow i have problem in datagridview as follows-->
its urgent plz tell fast if possible,
i have bound my datagridview to mytable,
so accordingly it is displaying columns from database,
.....but i wnt to change width of columns that are displyed in datagridview so i wrote
datagridviw.columns(0).width=50
but it gives error that "u cant resize bounded control"
wht shuld i do?
priya
|
|
|
|
|
No mam , I am not facing the problem u mentioned.
It is working . I tested the same code.
|
|
|
|
|
goodmorning pankaj,
i m told abt my problem related to datagridview column.width.
i had pr oblem yesterday & i was asking u....let it b ....my problem is solved now.
priya
|
|
|
|
|
hi everybody,
i wnt to animate(means revolve it from right to left) text on my MDI form's statusbar label do u know how to do it?
priya
|
|
|
|
|
might not be the best way to do it, but this is one way:
Imports System.Timers
Public Class Form1
Private Delegate Sub ScrollText()
Private moTimer As Timer
Private moDelegate As ScrollText = New ScrollText(AddressOf MoveIt)
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
moTimer.Stop()
moTimer.Dispose()
moTimer = Nothing
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Text = "this is a test of the scrolling feature. "
moTimer = New Timer(500)
moTimer.AutoReset = True
AddHandler moTimer.Elapsed, AddressOf Timer_Event
moTimer.Start()
End Sub
Private Sub MoveIt()
Me.Text = Mid(Me.Text, 2, Me.Text.Length) & Mid(Me.Text, 1, 1)
End Sub
Private Sub Timer_Event(ByVal sende As Object, ByVal e As System.Timers.ElapsedEventArgs)
Me.Invoke(moDelegate)
End Sub
End Class
|
|
|
|
|
Dear i need to make a utility which unzip the zip files please help me...
Feroze
|
|
|
|
|
Hi Feroze,
there is an implementation in java.util.zip.
xingla
|
|
|
|
|
Hi Friends,
Please give me the answer of my question :
My question is :
What is the difference between Leave and LostFocus events of textbox in vb.net? When I move the focus of textbox1 to textbox2 then the error will occur. Please see following code. Run it and give me the positive reply. It's urgent....
Program Code 1 of Lostfocus Event. But It gives error and not properly run :-
Public Class Form1
Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus
If TextBox1.Text = "" Then
MsgBox("enter valid values in textbox1")
End If
End Sub
Private Sub TextBox2_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.LostFocus
If TextBox2.Text = "" Then
MsgBox("enter valid values in textbox2")
End If
End Sub
End Class
Program Code 2 of Leave Event. And it is properly run :-
Public Class Form1
Private Sub TextBox1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Leave
If TextBox1.Text = "" Then
MsgBox("enter valid values in textbox1")
End If
End Sub
Private Sub TextBox2_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.Leave
If TextBox2.Text = "" Then
MsgBox("enter valid values in textbox2")
End If
End Sub
End Class
Give me the difference between these two event after studying it.
Please Help Me......
I am waiting for your answer!!!!!!!!!!!!
Thanks,
Bye.
Khushvadan Trivedi
Khushvadan Trivedi
|
|
|
|
|
Major Difference is in the order of occurance
Mouse and Keyboard Event fires Leave and LostFocus Event differently
Mouse first has lostfocus and then Leave
Whereas Keyboard fires Leave event first and then LostFocus
Primarily LostFocus is Mouse Event
Point To Note : Microsoft has recommended not to use LostFocus Event and you may not find LostFocus event in future versions
so please dont get with lostfocus anywhere in your code
Navneet Hegde
Program2Develop and Develop2Program
|
|
|
|
|
Hi.. i'm Deden
I want a question how to tuning TV tuner from msVidctl.dll
My program not running in XP SP2. i don't how about. please give me infomation
this sample my tv tuner program :
Dim objTuneRequest As IChannelTuneRequest
Dim mobjTSContainer As New SystemTuningSpaces
Dim objAnalogTuneSpace As New AnalogTVTuningSpace
Set objTuneRequest = mobjTSContainer("MyTV").CreateTuneRequest
If Not mblnRunned Then
VidControl.View objTuneRequest
On Error GoTo failed
objAnalogTuneSpace.UniqueName = "Antenna"
objAnalogTuneSpace.FriendlyName = "Local Analog Antenna"
objAnalogTuneSpace.CountryCode = 62
objAnalogTuneSpace.InputType = TunerInputAntenna
objAnalogTuneSpace.NetworkType = "{B820D87E-E0E3-478f-8A38-4E13F7B3DF42}"
VidControl.Run
mblnRunned = True
End If
objAnalogTuneSpace.FrequencyMapping = "687250000"
objTuneRequest.Channel =50
VidControl.View objTuneRequest
lbCh.Caption = "Channel : " & i
Exit Sub
VidControl.Build
failed:
Resume
Best regard
Deden
|
|
|
|