473,749 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need to jump to the start of my forms code...

I need to be able to jump to the start of my code if a particular radio button is not pressed. How do I this??? The goto line1 does not work?

Any ideas?

Scott

If Not RadBut4.Checked Or RadBut5.Checked Then

MsgBox("Please choose Annual or Single Trip")

'GoTo Line1 goto start needed...

Nov 21 '05 #1
15 1229
"Scott" <ho*******@virg in.net> schrieb:
I need to be able to jump to the start of my code if a particular radio
button is not pressed. >How do I this??? The goto line1 does not work?
\\\
Line1:
///
If Not RadBut4.Checked Or RadBut5.Checked Then

MsgBox("Plea se choose Annual or Single Trip")

'GoTo Line1 goto start needed...


You will have to create a label in order to jump to a certain position.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
OK I will do that, how will I code it?
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
"Scott" <ho*******@virg in.net> schrieb:
I need to be able to jump to the start of my code if a particular radio
button is not pressed. >How do I this??? The goto line1 does not work?


\\\
Line1:
///
If Not RadBut4.Checked Or RadBut5.Checked Then

MsgBox("Pleas e choose Annual or Single Trip")

'GoTo Line1 goto start needed...


You will have to create a label in order to jump to a certain position.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
"Scott" <ho*******@virg in.net> schrieb:
OK I will do that, how will I code it?


As I said, prefix the first line with 'Line1:' and call 'GoTo Line1' to jump
to the "label" 'Line1'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4
Scott,

First you have give the user change to check it, this will only get a loop
and a crazy user. Probably you have seen those AVI's from a user jumping on
his srcreen and other like that.

So you set this in a windows.forms.t imer (you can drag that from the
toolbox).
Start from the toolbox the event from that and set it to enabled when needed
and than an timer where you set the interval to 10 or something so it fires
direct.

http://msdn.microsoft.com/library/de...ClassTopic.asp

Than in that event something as

mytimer.enabled = false
If Not RadBut4.Checked Or RadBut5.Checked Then
MsgBox("Please choose Annual or Single Trip")
mytimer.interva l = 4000
'dont set it to low a user has to be able to do something, he has to click
this button and to set the button
mytimer.enabled = true 'when you dont do it like this it goes on
firing.
end if

I hope this helps?

Cor


..
Nov 21 '05 #5
How about this:

If Not RadBut4.Checked or RadBut5.Checked Then
MsgBox("Please choose Annual or Single Trip")
Exit Sub
Else
' whatever you are doing if they do the above
End If
(or you can just leave out the Else statement and just use, End If and afte that point the rest of your code in the sub.)

That will put your user back to the beginning. Not like GoTo Line 1 in Quick Basic etc. but, it will EXIT the Sub you are in
(after your user Clicks OK in the MessageBox) and then they can start over at the point they entered the wrong
data........(un less you have had them entering a lot of stuff prior to this.....depend s on the rest of your code)
james

"Scott" <ho*******@virg in.net> wrote in message news:gp******** *******@newsfe5-gui.ntli.net...
I need to be able to jump to the start of my code if a particular radio button is not pressed. How do I this??? The goto line1
does not work?

Any ideas?

Scott

If Not RadBut4.Checked Or RadBut5.Checked Then

MsgBox("Please choose Annual or Single Trip")

'GoTo Line1 goto start needed...
Nov 21 '05 #6
Hi Scott

Despite all the previous answers, please consider the following construct:

Do
Test for Success

If AllIsWell Then
Exit Do
Endif
Loop

This would the structured answer to your question.

HTH

Charles
"Scott" <ho*******@virg in.net> wrote in message
news:gp******** *******@newsfe5-gui.ntli.net...
I need to be able to jump to the start of my code if a particular radio
button is not pressed. How do I this??? The goto line1 does not work?
Any ideas?
Scott
If Not RadBut4.Checked Or RadBut5.Checked Then
MsgBox("Please choose Annual or Single Trip")
'GoTo Line1 goto start needed...
Nov 21 '05 #7
Charles,

You this was of course my first thought and answer and than I looked at the
code.

I tried to find that video from that guy who was first hitting and than
broke his screen.

This will in my opinion give and endless popup screen.

:-)

Cor
Nov 21 '05 #8
You this

You would know this
Nov 21 '05 #9
Hi Cor

I'm not sure that I follow you. The intention is that if AllIsWell then the
code will exit the loop, and no more pop-up screen. If the test involves
looking at a radio button, then isn't this effectively what the OP asked
for?

Charles
"Cor Ligthert" <no************ @planet.nl> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Charles,

You this was of course my first thought and answer and than I looked at
the code.

I tried to find that video from that guy who was first hitting and than
broke his screen.

This will in my opinion give and endless popup screen.

:-)

Cor

Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
4107
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
5
2221
by: taylorjonl | last post by:
I am completely baffled. I am writting a daemon application for my work to save me some time. The application works fine at my home but won't work right here at work. Basically I have a MainForm what has a Start/Stop button that starts and stops the processing thread. private void StartButton_Click(object sender, System.EventArgs e) { if( bStopSignal ) { // disable controls that aren't valid when running
2
2975
by: P2P | last post by:
Hi I am wondering if someone know of a free cross-browsers vertical scrolling script that - is cross cross-browsers - will call the scrolling content from an external html page or from a url page
2
7907
by: Leo | last post by:
I set HasMorePages to true, but it doesn't let me jump to next page. (Of course, if I remove the HasMorePages = false in my if statement, it will create hundreds of pages). Any suggestion? Thanks in advance. Leo My code to call the print event: .... {
6
5042
by: Todd A. Anderson | last post by:
I have a function foo of which I need to get the address. The problem is that when you say "&foo" (or just foo for that matter), you get the address of this function's entry in a jump table and not the address of the function itself. Are there any BKMs for getting the real address or am I going to have to write a function that looks to see whether the address is a jump instruction and if so compute the real address from the jump target?...
1
5125
by: jianxin9 | last post by:
Hi, I have an ajax powered tabs box that has a javascript drop-down search menu in the first tab. When I click on another tab, and go back to the first tab I have to refresh the page to get the information to load. Any suggestions on how I might get around that. The articles tab is the tab where the javascript won't load. Thanks so much for any help you might be able to provide: This is what the tabs code looks like: <ul...
9
3942
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result - I have read every post out there and spent hours trying to figure out the problem with no success whatsoever - I have constrained the problem to one form however, and I think it's hiding somewhere in my code associated with this form, which is...
11
3387
by: Peted | last post by:
Im using c# 2005 express edition Ive pretty much finished an winforms application and i need to significantly improve the visual appeal of the interface. Im totaly stuck on this and cant seem to work out how to start on a solution. I have of course used a varienty of componets, mostly radio buttons with "button" appearence.
5
3620
by: iapx86 | last post by:
My parser project calls for a computed goto (see code below). The C preprocessor delivers the desired result, but is ugly. Template metaprogramming delivers results I do not understand. Can anyone explain why loop unrolling doesn't play well with templates? Or better, can someone submit a code fragment to get desired results? Here are the command-lines I use to generate code: "g++ -DTEMPLATE=0 -o gotofun0 gotofun.cpp" works exactly as...
0
8997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9389
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9335
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8257
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.