?
Solved

Messaging form.

Posted on 2007-10-10
5
Medium Priority
?
188 Views
Last Modified: 2010-04-23
I created a similar form in access and am trying it in visual basic.net. I have a form with a few fields including a checkbox. What I want is when the program loads this form to be hidden. I have put a timer on my main form that I want to check if the checkbox on this form is false to show the form. What is wrong? Am I going about this the right way? Just looking for a way to send messages to all users logged in at the same time.

If Message_Receive.CheckCheckBox.Text = True Then     <<<<Conversion from string "" to type 'Boolean' is not valid.>>>>
            Message_Receive.Show()
        Else
            Message_Receive.Hide()

        End If


0
Comment
Question by:wiswalld
  • 3
5 Comments
 
LVL 48

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 20050339
Hi wiswalld,

Use the Checked property of the checkbox....

    If Message_Receive.CheckCheckBox.Checked = True Then

Regards,

Wayne
0
 
LVL 13

Author Comment

by:wiswalld
ID: 20050639
Thanks got that part. But still not sure if I am going about this correctly. When my main form opens I hide this form (message_receive). What I want is a timer that will check for a value in the checkbox and if exists show the message_receive form. Right now when the program starts I see the message_receive form for a split second but never see it again. Will this check back with the access database if someone sends a new message?

This is in the load for my main form:

 Message_Receive.Hide()
        Me.Timer1.Interval = 1000
        Me.Timer1.Enabled = True

Then the timer event:
If Message_Receive.CheckCheckBox.Checked = False Then

            Message_Receive.Show()
        Else
            Message_Receive.Hide()

        End If
0
 
LVL 13

Author Comment

by:wiswalld
ID: 20051369
curious if the fact that my main form is an mdi form. When I first open my program the message_receive form flashes for a second then appears to close. I just want it minimized in the background. If I try to use message_receive.show() it opens but closes after my mdi form opens.
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 750 total points
ID: 20051847
Why are you using a Timer?...use the CheckChanged() event of your CheckBox to be notified when it has been clicked by the user:

    Private Sub CheckCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckCheckBox.CheckedChanged
        If CheckCheckBox.Checked = True Then
            Message_Receive.Show()
        Else
            Message_Receive.Hide()
        End If
    End Sub

*** BUT *** it looks like the CheckBox is actually on the "Message_Receive" form...which is hidden.  So you can the user click it?...
0
 
LVL 13

Author Comment

by:wiswalld
ID: 20052195
What I have is two forms both with the same fields based on the same table. The user will enter date, time and message and save. The message_receive form which is minimized will detect a new message by the unchecked checkbox (should be false above not true) and maximize form. Then click a button to show the message as read and check the checkbox which will then minimize the form. I have done this in access with no problems, but VB not so lucky.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question