Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

VB.NET Programming Corner!

Ganito po ba sir

sa Main Form ko

Public Sub New()

btnJapan.Tag = Ctype(FrmJapan,Object) 'Nagkakaerror ako dito
btnPhil.Tag = Ctype(FrmPhilippines,Object)
End Sub

Then sa Button event ko

Dim Btn As Button = Ctype(sender,Button)
Dim _LoadForm as Form = Ctype(Btn.Tag,Form)
_LoadForm.Show

Thanks sa reply
 
Pa help po nais ko po sanang mangyari sa code na to ay ganito po
pag hindi ko na click si button1 hindi po gagana si button2 at mag soshow ng messagebox na (Please Recompute) panu po un eto po na umpisahan ko kaso ayaw gumana ng please recompute

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If Not IsNumeric(TextBox1.Text) Or Not IsNumeric(TextBox2.Text) Or Not IsNumeric(TextBox3.Text) Or Not IsNumeric(TextBox4.Text) Then
MessageBox.Show("Invalid Input", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf 99 >= TextBox1.Text Or 99 >= TextBox2.Text Or 99 >= TextBox3.Text Or 99 >= TextBox4.Text Then
MessageBox.Show("Invalid Amount", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)

If Label2.Text = "" Then
MessageBox.Show("Please Recompute", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Label3.Text = "" Then
MessageBox.Show("Please Recompute", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Label4.Text = "" Then
MessageBox.Show("Please Recompute", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Form5.Label1.Text = TextBox5.Text
Form5.Label2.Text = TextBox6.Text
Form5.Label3.Text = TextBox7.Text
Form5.Label4.Text = ComboBox4.Text
Form5.Label5.Text = TextBox8.Text
Form5.Label6.Text = ComboBox1.Text
Form5.Label7.Text = Label1.Text
Form5.Label8.Text = Label2.Text
Form5.Label9.Text = Label3.Text
Form5.Label10.Text = Label4.Text
Form5.Show()
Me.Hide()
End If
End If
End Sub
 
kung pinasok mo sa tag yung form as object pwede yon iconvert mo muna search mo ang "ctype" para ma convert mo yung tag as form then show na. di mo na need ng if else or select case.

Ok na sir thanks
kaya pala hindi gumana yung sakin kase as string ko nilagay yung mga Form :upset:

Salamat meron na naman ako natutunan :thumbsup:
 
Ok na sir thanks
kaya pala hindi gumana yung sakin kase as string ko nilagay yung mga Form :upset:

Salamat meron na naman ako natutunan :thumbsup:

sorry ngayon lang din ako nakabukas di ko nareplyan yung una mo tanong. anyway good nagawa mo na.
 
Pa help po nais ko po sanang mangyari sa code na to ay ganito po
pag hindi ko na click si button1 hindi po gagana si button2 at mag soshow ng messagebox na (Please Recompute) panu po un eto po na umpisahan ko kaso ayaw gumana ng please recompute

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If Not IsNumeric(TextBox1.Text) Or Not IsNumeric(TextBox2.Text) Or Not IsNumeric(TextBox3.Text) Or Not IsNumeric(TextBox4.Text) Then
MessageBox.Show("Invalid Input", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf 99 >= TextBox1.Text Or 99 >= TextBox2.Text Or 99 >= TextBox3.Text Or 99 >= TextBox4.Text Then
MessageBox.Show("Invalid Amount", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)

If Label2.Text = "" Then
MessageBox.Show("Please Recompute", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Label3.Text = "" Then
MessageBox.Show("Please Recompute", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Label4.Text = "" Then
MessageBox.Show("Please Recompute", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf Form5.Label1.Text = TextBox5.Text
Form5.Label2.Text = TextBox6.Text
Form5.Label3.Text = TextBox7.Text
Form5.Label4.Text = ComboBox4.Text
Form5.Label5.Text = TextBox8.Text
Form5.Label6.Text = ComboBox1.Text
Form5.Label7.Text = Label1.Text
Form5.Label8.Text = Label2.Text
Form5.Label9.Text = Label3.Text
Form5.Label10.Text = Label4.Text
Form5.Show()
Me.Hide()
End If
End If
End Sub

teka, sabi mo button1 ang basis mo kung gagana ang button 2 or hindi. dapat dun ka mag lagay ng tag sa button1 kung na click na or hindi. yun ang icheck mo kung ano ang status. and dapat hindi ganyan walang naming conventions. kung gusto mo ipursue ang programming wag mo gagawin yan hirap imaintain.
 
Mga sir... ask lang po about report max..pano ma resize yung paper para sa report?
 
Pahelp po.. paano po mabypass po ito? kumbaga hindi na po ito lumalabas po?

Note: Natry ko na ang TRY CATCH and ON ERROR RESUME NEXT kaso lumalabas po talaga iyan.

May event po ba na pwede ibypass po iyan or ibang solusyon?:help::help::help::help::help:

rex_1.png
 
Ganito po ba sir

sa Main Form ko

Public Sub New()

btnJapan.Tag = Ctype(FrmJapan,Object) 'Nagkakaerror ako dito
btnPhil.Tag = Ctype(FrmPhilippines,Object)
End Sub

Then sa Button event ko

Dim Btn As Button = Ctype(sender,Button)
Dim _LoadForm as Form = Ctype(Btn.Tag,Form)
_LoadForm.Show

Thanks sa reply

d yta pede ang class = object

Code:
btn click event()
Dim asm As Assembly = Assembly.GetEntryAssembly()
Dim path As String = asm.GetName().ToString()
path = path.Substring(0, path.IndexOf(","))
Dim formname As String = path & "Your_Form_or_class_name_here"
Dim formtype As Type = asm.[GetType](formname)
Dim f As Form = DirectCast(Activator.CreateInstance(formtype), Form)
f.Show()
reference code:
http://www.c-sharpcorner.com/blogs/3611/create-instance-from-string-name-in-c-sharp.aspx

ang laman ng btn.tag = "FormName"
 
Last edited:
sir, can i have a link to your tutorial about vb.net (C.R.U.D) using mssql as the DB. kasi yung nakikita ko MSAccess eh,.
 
cno po meron ng computer aided instruction or learning software dyan pwd po pa share? pag aaralan ko lng po, CAI kc thesis na gagawin ko...sana may makatulong..pa pm narin po plsss
 
Ganito po ba sir

sa Main Form ko

Public Sub New()

btnJapan.Tag = Ctype(FrmJapan,Object) 'Nagkakaerror ako dito
btnPhil.Tag = Ctype(FrmPhilippines,Object)
End Sub

Then sa Button event ko

Dim Btn As Button = Ctype(sender,Button)
Dim _LoadForm as Form = Ctype(Btn.Tag,Form)
_LoadForm.Show

Thanks sa reply

gamit ka nalang ng collection or dictionary
dun mo lagay lahat ng objects para ma reference mo by name
 
Back
Top Bottom