Click here to Skip to main content
15,921,295 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: listview doubt Pin
Christian Graus22-Jun-07 21:48
protectorChristian Graus22-Jun-07 21:48 
Questiondeployment problem (Window application) Pin
Sonia Gupta22-Jun-07 18:48
Sonia Gupta22-Jun-07 18:48 
AnswerRe: deployment problem (Window application) Pin
Christian Graus22-Jun-07 21:49
protectorChristian Graus22-Jun-07 21:49 
QuestionUsing nested IFs in another form for action in main form Pin
marshmayllow22-Jun-07 5:49
marshmayllow22-Jun-07 5:49 
AnswerRe: Using nested IFs in another form for action in main form Pin
Kschuler22-Jun-07 6:10
Kschuler22-Jun-07 6:10 
GeneralRe: Using nested IFs in another form for action in main form Pin
marshmayllow22-Jun-07 8:36
marshmayllow22-Jun-07 8:36 
GeneralRe: Using nested IFs in another form for action in main form Pin
Kschuler22-Jun-07 8:42
Kschuler22-Jun-07 8:42 
AnswerRe: Using nested IFs in another form for action in main form Pin
Dave Kreskowiak22-Jun-07 8:50
mveDave Kreskowiak22-Jun-07 8:50 
marshmayllow wrote:
I put the code in the btnOK_click event

IF options.dialogresult = windows.forms.dialogresult.OK Then

If radiobutton1.checked = true then
picMain.image = picA.image
End if
If radiobutton2.checked = true then
picMain.image = picB.image
End if
End If


If thise code is on the Options form, it won't work. Similarly, if it's on the Main form, it wont work for different reasons.

You OK button event handler on the Options form should normally do nothing but validate the information on the form. Since all you have is a couple of radio buttons, you really should even have an event handler for the OK button.

This could should go in the section where you created and displayed the Options form:
Dim optionsForm As New OptionsForm
If optionsForm.ShowDialog() = DialogResult.Ok Then
    If optionsForm.radiobutton1.checked Then
        picMain.image = picA.image
    End if

    If radiobutton2.checked = true then
        picMain.image = picB.image
    End if
End If

This is only a sample of what's wrong. Depending on your requirements for functionality, there are MANY more problems with this code.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


AnswerRe: Using nested IFs in another form for action in main form Pin
Christian Graus22-Jun-07 14:22
protectorChristian Graus22-Jun-07 14:22 
AnswerRe: Using nested IFs in another form for action in main form Pin
marshmayllow22-Jun-07 22:25
marshmayllow22-Jun-07 22:25 
QuestionInherit constraints from database query Pin
kermit88822-Jun-07 5:39
kermit88822-Jun-07 5:39 
QuestionPlease Help me with PopUp Pin
s3ad200222-Jun-07 5:36
s3ad200222-Jun-07 5:36 
AnswerRe: Please Help me with PopUp Pin
leckey22-Jun-07 9:31
leckey22-Jun-07 9:31 
QuestionWeird Syntax Error Pin
Kerry Drake22-Jun-07 4:48
Kerry Drake22-Jun-07 4:48 
AnswerRe: Weird Syntax Error Pin
ctwalker22-Jun-07 4:57
ctwalker22-Jun-07 4:57 
AnswerRe: Weird Syntax Error Pin
AlexeiXX322-Jun-07 8:51
AlexeiXX322-Jun-07 8:51 
QuestionMicrosoft Office Document Image Writer Pin
dBrong22-Jun-07 4:39
dBrong22-Jun-07 4:39 
AnswerRe: Microsoft Office Document Image Writer Pin
Dave Kreskowiak22-Jun-07 5:00
mveDave Kreskowiak22-Jun-07 5:00 
GeneralRe: Microsoft Office Document Image Writer Pin
dBrong22-Jun-07 5:09
dBrong22-Jun-07 5:09 
GeneralRe: Microsoft Office Document Image Writer Pin
Dave Kreskowiak22-Jun-07 8:54
mveDave Kreskowiak22-Jun-07 8:54 
GeneralRe: Microsoft Office Document Image Writer Pin
dBrong22-Jun-07 13:33
dBrong22-Jun-07 13:33 
QuestionImports - Count files in a folder Pin
Central_IT22-Jun-07 4:28
Central_IT22-Jun-07 4:28 
AnswerRe: Imports - Count files in a folder Pin
Kerry Drake22-Jun-07 4:54
Kerry Drake22-Jun-07 4:54 
AnswerRe: Imports - Count files in a folder Pin
originSH22-Jun-07 4:54
originSH22-Jun-07 4:54 
AnswerRe: Imports - Count files in a folder Pin
Dave Kreskowiak22-Jun-07 4:58
mveDave Kreskowiak22-Jun-07 4:58 

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.