473,396 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

visual basic 2005 help

Simple one for you guys i hope, bit of a newbie at this:

i have a text box that i need to be filled in i have a statement to display a text box if it is blank which works but it still moves on to the next screen how do i end the process if it is blank and display the message?

Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
If TextBox1.Text = "" Then MsgBox("Fill in Name") Else
Label6.Text = TextBox1.Text
TextBox1.Hide()
Label5.Hide()
Label6.Show()
Label7.Show()

This is what i got thanks for your help
Nov 9 '06 #1
4 1988
willakawill
1,646 1GB
Simple one for you guys i hope, bit of a newbie at this:

i have a text box that i need to be filled in i have a statement to display a text box if it is blank which works but it still moves on to the next screen how do i end the process if it is blank and display the message?

Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
If TextBox1.Text = "" Then MsgBox("Fill in Name") Else
Label6.Text = TextBox1.Text
TextBox1.Hide()
Label5.Hide()
Label6.Show()
Label7.Show()

This is what i got thanks for your help
Hi. Don't know about this Hide() method.
In VB6 to make a control disappear you need to set the visible property to false

TextBox1.Visible = False

and

TextBox1.Visible = True

To make it reappear
Nov 9 '06 #2
the rest works and the show and hide is fine its just i want to know how to stop it going to that stage if the box is blank. i can get it to display the text box but when you press ok it still goes to the next stage i wnat to know what to type to stop it
Nov 9 '06 #3
the rest works and the show and hide is fine its just i want to know how to stop it going to that stage if the box is blank. i can get it to display the text box but when you press ok it still goes to the next stage i wnat to know what to type to stop it
sorry i mean msgbox not text box! I can get it to display the msgbox but it then still goes to the next stage what do i need to type to stop it?
Nov 9 '06 #4
willakawill
1,646 1GB
sorry i mean msgbox not text box! I can get it to display the msgbox but it then still goes to the next stage what do i need to type to stop it?
OK I see.
The structure of the If..Then..Else..End If block is important
There is no speed improvement by writing it on one line.

Expand|Select|Wrap|Line Numbers
  1.  If condition Then
  2.    'do something here
  3.    Exit Sub 'this might be the part that is missing
  4. Else
  5.    'do something else here
  6. End If
  7.  
Nov 9 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: jmespinosabaviera | last post by:
1) Does visual studio standard 2005 include visual basic ?. 2) What difference is there between the visual studio standard 2005 and the professional version ? 3) What difference is there...
2
by: elnahrawi | last post by:
Download ebook http://books-download.com/?Book=1487-Visual+Basic+2005+Jumpstart Okay, all you VB6 developers--time's up. As of March 2005, Microsoft no longer supports this version of Visual...
10
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied...
4
by: jeff | last post by:
We current a VS 2005 Professional license ... what does this Microsoft Visual Studio 2005 Tools for Applications offer that VS 2005 does not? Any help would be greatly appreciated. Thanks...
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
6
by: Carol | last post by:
Hi. When I try to run Visual Studio 2003 I get the message "MS development environment is not installed for the current user. Please run setup to install the application." Is there any way to...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
1
by: FlyingBuckner | last post by:
All right be kind, this is my first question on a forum. I need help on selecting the right software to purchase. I have a database set up using Access, 6 users. It is split into Tables and...
11
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have seen the terms Visual Basic 2005 and VB.NET. It seems that sometimes they seem to be referring to the same thing but sometimes they are not. I also run into terms like VB9 and VB10.
4
by: Goran Djuranovic | last post by:
Hi all, I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page. -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.