-
Oct 30th, 2011, 07:01 AM
#1
Thread Starter
Member
customizing message box
i have two form
in one form i salect some thing and click on done button a mesage box prompt me that u selcet this and this
and on the other form a button result is place.. when i click on it a new form appears and the msg box text that appears on msg box appears in label which is on 3rd form... now what i do .. its not run first i do simple coading but i think its nt rgt
for first form
vb Code:
Dim p As Integer
Private Sub Command1_Click()
p = MsgBox("thanku your text box value is" & vbCr & Text1.Text)
End Sub
form 3rd form
Dim p As String
Private Sub Form_Load()
Label1.Caption = Form1.p
End Sub
its say method and data member not found its means all code is wrong what i do now... plzzz telll me
Last edited by Hack; Oct 30th, 2011 at 07:15 AM.
Reason: Added Highlight Tags
-
Oct 30th, 2011, 07:18 AM
#2
Re: customizing message box
Moved From the Codebank (which is for sharing code rather than posting questions
-
Oct 30th, 2011, 09:44 AM
#3
Re: customizing message box
On Form1.
Not: Dim p As Integer
But: Public p As Integer
-
Oct 30th, 2011, 10:00 AM
#4
Thread Starter
Member
Re: customizing message box
ok iwill do this but
for form 1
Public p As Integer
Private Sub Command1_Click()
p = MsgBox("thanku your text box value is" & vbCr & Text1.Text)
for form 3
Public p As Integer
Private Sub Form_Load()
Label1.Caption = Form1.p
End Sub
End Sub
Private Sub Command2_Click()
Form2.Show
Form1.Hide
End Sub
it run accuratly but not give the rgt output just give 1 in label i tried many time with diffrnt ways but.. now what i do... why it gives 1
-
Oct 30th, 2011, 10:07 AM
#5
Re: customizing message box
No you create a module and up in the general declarations put Public p as Integer, not in every form. Doing it in the module will allow that variable p to be accessible in all forms and modules with just one line of code. So you will no longer need the Form1.p. Just p
-
Oct 30th, 2011, 10:07 AM
#6
Re: customizing message box
I've answered a question like this recently. See if this thread helps
-
Oct 30th, 2011, 10:16 AM
#7
Thread Starter
Member
Re: customizing message box
ya i have alredy do this and this time its give 0 in out put.... thats nt rgt ...
-
Oct 30th, 2011, 10:16 AM
#8
Thread Starter
Member
Re: customizing message box
LaVolpe... i don't understand that thread
-
Oct 30th, 2011, 10:28 AM
#9
Re: customizing message box
Originally Posted by Misbah
LaVolpe... i don't understand that thread
Spend some time trying to understand it or search the forums for other examples of custom message boxes.
Your custom message box should do the following
1. When shown, stop the calling line of code so it waits for the message box to close
2. When the message box closes, it's result must be available to the line of code that called it
The other thread I linked to does that
1. When the custom msgbox form is shown, it makes itself modal. This prevents the calling code from continuing. It also makes the message box form wait until one of its buttons is clicked.
2. Whenever one of the buttons on the form is clicked, it sets a value to the m_Result variable and unloads the form. This action allows the custom message box to return the value to the calling code. The calling code now continues
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|