Click here to Skip to main content
16,006,749 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionConvert text to Tiff using MODI Pin
Harish Chawla29-Aug-05 22:23
Harish Chawla29-Aug-05 22:23 
QuestionError " variable uses an Automation type not supported in Visual Basic Pin
rajesh_kapure29-Aug-05 21:52
rajesh_kapure29-Aug-05 21:52 
QuestionDynamically adding image to a datagrid column Pin
BORN...again!29-Aug-05 20:59
BORN...again!29-Aug-05 20:59 
AnswerRe: Dynamically adding image to a datagrid column Pin
BORN...again!30-Aug-05 17:02
BORN...again!30-Aug-05 17:02 
Questionaccess to another forms objects Pin
hakanaktan29-Aug-05 20:30
hakanaktan29-Aug-05 20:30 
AnswerRe: access to another forms objects Pin
prathiba_naresh29-Aug-05 22:50
prathiba_naresh29-Aug-05 22:50 
QuestionRe: access to another forms objects Pin
hakanaktan29-Aug-05 23:19
hakanaktan29-Aug-05 23:19 
AnswerRe: access to another forms objects Pin
prathiba_naresh30-Aug-05 0:05
prathiba_naresh30-Aug-05 0:05 
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.





GeneralRe: access to another forms objects Pin
hakanaktan30-Aug-05 4:06
hakanaktan30-Aug-05 4:06 
QuestionAdding items to DataGrid in runtime Pin
Member 223436029-Aug-05 20:22
Member 223436029-Aug-05 20:22 
AnswerRe: Adding items to DataGrid in runtime Pin
BORN...again!29-Aug-05 21:01
BORN...again!29-Aug-05 21:01 
GeneralRe: Adding items to DataGrid in runtime Pin
Member 223436029-Aug-05 23:16
Member 223436029-Aug-05 23:16 
GeneralRe: Adding items to DataGrid in runtime Pin
BORN...again!30-Aug-05 17:01
BORN...again!30-Aug-05 17:01 
GeneralRe: Adding items to DataGrid in runtime Pin
kpsetty2-Sep-05 5:50
kpsetty2-Sep-05 5:50 
QuestionWindows Forms Message Box Pin
JayaDurai29-Aug-05 19:05
JayaDurai29-Aug-05 19:05 
AnswerRe: Windows Forms Message Box Pin
Christian Graus29-Aug-05 19:21
protectorChristian Graus29-Aug-05 19:21 
GeneralRe: Windows Forms Message Box Pin
JayaDurai30-Aug-05 20:06
JayaDurai30-Aug-05 20:06 
GeneralRe: Windows Forms Message Box Pin
Christian Graus1-Sep-05 12:27
protectorChristian Graus1-Sep-05 12:27 
QuestionDelete Record in datagrid not working Pin
BORN...again!29-Aug-05 17:49
BORN...again!29-Aug-05 17:49 
Questiondail a telephone number ,and when the person lifts up the telephone ... Pin
sunnf29-Aug-05 15:53
sunnf29-Aug-05 15:53 
QuestionGet hotfixes type and DLL language Pin
highdoe29-Aug-05 12:25
highdoe29-Aug-05 12:25 
AnswerRe: Get hotfixes type and DLL language Pin
Dave Kreskowiak29-Aug-05 13:13
mveDave Kreskowiak29-Aug-05 13:13 
GeneralRe: Get hotfixes type and DLL language Pin
highdoe29-Aug-05 20:41
highdoe29-Aug-05 20:41 
GeneralRe: Get hotfixes type and DLL language Pin
Dave Kreskowiak30-Aug-05 2:32
mveDave Kreskowiak30-Aug-05 2:32 
Questiongetting ids Pin
Secrets29-Aug-05 11:17
Secrets29-Aug-05 11:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.