VS 2008 : Get A Msgbox With Some Text And A Yes And No Option?
May 11, 2009I want a msgbox with some text, and a Yes and No option..Why wont this code work?
MsgBoxStyle.YesNo ("TEXT")
I want a msgbox with some text, and a Yes and No option..Why wont this code work?
MsgBoxStyle.YesNo ("TEXT")
I've just started using Visual Basic - I'm completely new to programming altogether and thought it might be a useful skill - and I've been slowly working my way through the tutorials - from 'Learn VB' in the Start Page - and now the MsgBox function has disappeared! I have no idea why, as I'm doing the same thing (I think) as I was always doing. New Project > Windows Forms Application > Right Click on 'Form 1' in the solutions box > Source Code. Anyhow; when I type MsgBox there is neither a dropdown box with that name (IDE I think it's called?) and it becomes underlined with a squiggly blue line. I seem to remember that, in the IDE box, there were several different types of logos next to each name, but now only the logo that shows a windows with what looks like green highlighter written on it (you can see it if you type in #If) appears. I've already restarted the computer (via the start menu).
ps. I'm Running 'Visual Basic Express 2008' - and downloaded that yesterday (23/11/09)
I am using this code right now
If i.Contains("1") Then
MsgBox("2")
Else
End If
But what I want to do it have it check multiple text like this
If i.Contains("1") or ("2") or ("3")Then
MsgBox("H2")
Else
End If
But that doesn't work?
If NewEntryName.Text = "" And OpenFileDialog1.FileName = Nothing Then MsgBox("Please choose a name for your game.", vbExclamation) MsgBox("Please find your game.", vbExclamation) Else Button1.Text = NewEntryName.Text game1 = True Panel1.Visible = False End If
I want it to show the first MsgBox if the NewEntryName.text = "" and I want it to show the second MsgBox if openfiledialog1 = nothing... how do I do it?
if its possible to have a msgbox cleared without having the user do it manually? what would be my best option here?
View 8 Repliesis it possible to center text in a msgbox in vb.net? (similar to the < center> in html) this is not centering itself:
[Code]...
I'm looking for a way to format lines on a MsgBox, so that the records don't seem out of place.What I have is this:If you can't see it it's something like this:
Num Name HF
1 something 11
2 somethingelse 22
[code]......
Is this possible in VB 2008 ?!? If so can someone walk me through it?
View 2 RepliesWhen my software starts up, it connects to an Access database to get any update messages and displays them in a message box when the user starts the program.That part works, but I'm trying to figure out what should be put into the Access record to create new lines in the msgbox text. I've tried and arrangements of single and double quotes but everything's going on a single line.
View 5 Repliesscript to get text or search text for a certain word in another programs msgbox prompt?
View 1 RepliesI try to get the text on a website in a string/textbox/msgbox. The characters cannot be read somehow. I know the website is encoded in ISO-8859-1 (windows-1252). My current code is...
[Code]...
This should be pretty easy, I've been experimenting, just can't seem to figure it out. I'm trying to make a MsgBox popup with the text that is in Textbox1 and Textbox2. I want the MsgBox to display both values...
View 3 Replieshow can i make it so if i press f1 a msgbox will pop up?
View 7 RepliesSomething like this
VB.NET
If GetAsyncKeyState(System.Windows.Forms.Keys.H And e.KeyCode = Keys.E) Then
MsgBox("hello")
[code].....
I am trying to learn how to use message boxes. I am just starting out but really enjoy it. My basic structure is to have seven yes/no questions that change a variable(x) by adding + 1 to everytime you get the question right. My question lies within the message box and getting my variable to change with every question (or not if wrong button is pushed). Heres what I have coded so far...
HTML
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClick.Click
Dim x As Integer
Car(x)
[code]....
I have been getting no output and when i debug All values of x are 0. I only have one return and it is at the very end of the Car Function (Return x).
Im creating a program that stores usernames/passwords for different devices which will require a login to get into the program but I need to save the usernames/passwords somewhere. Is there a more secure way to store this than in a text file? Or I could try encryption which could be quite fun.
View 3 RepliesI'm looking for opinions on the safest/best way to append to a text file.These are my two current methods:)
Try
FileOpen(1, RecordingPath & "Log.txt", OpenMode.Append)
PrintLine(1, strAnalogOutput)
[code].....
I really like the coding speed that vb.net provides, but I don't like the possibility to forget to declare variable types, return types of functions, etc. and that is why in each class I use[code]..
Is there a way to define those two options on the project/solution level?
the combo box style 1 has both the drop down option but also a manual entry option. I need to know how to code it so that when you manually enter data, it takes that data and places it in a text message "The shipping charges for "data" is $15" displaying in a text box. Shouldn't be hard but have developed a mind block.
View 4 RepliesI have an array I know is getting initial values. I need to be able to see it's results visually like a msgbox. That will be the official output.
Sub SaveDestFile()
Dim StaffCode As String
Dim MyRec As String
Dim Duration As String
Dim FlagMe As String
[Code] ....
I have a text form with some text in it (html). I need to get the time into a msgbox (red).
"><span id="ctl00_cphMain_ucShowAuction1_lblTimeLeft">00:49</span></span></span></div>
How can you do that with regex ?
I know this is just a simple question but I could hardly find the value for the buttons in msgbox for code execution.I tried to use codes I did in vb6 and was able to execute the codes properly but when I started vb2008 I encountered logical error for these codes.Let me take you alook for the codes:[code]When you click the yesbutton it executes the Statement1 but if you click the nobutton it should only execute Statement2.
1.Why is it when you click the nobutton it would still execute the Statement1 instead of Statement2?
2.What would be the right If..Then...Else statement should be used to execute it properly?
I have a combobox and have 10 items in it (Name of countries). I want to make the users life easy so that when they click inside the combobox and start writing then the text box will start predicting the rest of the text in the combo box. i.e. if i start writing "U" then the textbox will start predicting "UK" as "UK" is already a pre-populated item in the combobox.
How can I restrict the user from selecting only values within the pre-populated items of the combobox. Bearing in mind the combobox allows the user to write inside it (for the benefit of predictive text). But lets say there are values of UK, USA then I dont want the combobox to accept the value of "Ukraine" when the user clicks away from the combobox.
So I want when you click Button1, it displays MsgBox ("Hello"), when you click again, it displays Msgbox("World"). Then it all starts Hello "world hello world" etc.
View 5 RepliesHow would I change the following code so that if the process isnt found, it will pop up a msgbox
[code]...
What are the pros and cons of standardizing on using Option Compare Text vs Option Compare Binary for VB.NET development?
- EDIT -Just some background since it seems like it would help - my development team has found it much easier to standardize on Option Strict On, Option Infer On, and Option Explicit due to their obvious advantages over the alternatives. What we haven't found as easy to standardize on is Option Compare Text/Binary as there seem to be advantages and disadvantages to both and different developers have differing opinions. Some of the arguments for each side have been as follows:
Some of the advantages/arguments for Option Compare Text:
It reduces verbosity in the code by removing the need for StringComparers and .ToLower() calls and StringComparison.OrdinalIgnoreCase all over the place Data needs are rarely concerned with casing, as evidenced by most databases being case-insensitive. Rarely would you ever really want to distinguish between THIS and This and this when doing a data comparison.
Certain specific use cases are simpler when you don't have to worry about casing. For example, handling ASP.NET control events where commands are sent to the codebehind as strings and casing-issues are difficult to track down as the compiler cannot help you. Think Select Case statements for <asp:repeater> events as an example.Many of the concerns raised about text comparison concern internationalization, which is often not that relevant to a lot of applications.VB specifically is case insensitive as a language, though Visual Studio helps you by at least enforcing consistency in your casing. SQL is case insensitive as well. Strings are the only place where you have to remember to worry about it, which highlights the awkwardness in ways you wouldn't normally notice it if you were worried about it everywhere.
Some of the advantages/arguments for Option Compare Binary:C# works this way, as do most other languages. It's somewhat unexpected to have alternate behavior and the unexpected is not good in programming.There is a slight performance penalty with Option Compare Text as evidenced by the IL generated on compile. Option Compare Binary doesn't have that penalty.Option Compare Text only makes certain parts of string handling case insensitive. But, it doesn't make it so that things like dictionary indexing are case insensitive by default. So, it's not like Option Compare Text actually makes it so that you don't have to worry about casing at all. If it only works half way, why bother?Programming is hard. It's best not to attempt to smooth over that fact. Worrying about string casing is part of the deal. Humans recognize THIS is different from This and tHiS. Of course your code should too - after all, they aren't really the exact same string.
i have written a sub routine for a Save>Menu option for a MDI Text Editor, Please see my code below
Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click
Dim f As Form2
If f.Text = "Text Editor V.2 - New Document" Then
[Code]...
How would I make it so that a messagebox loads after a page loads in a webbrowser control? Let's just make it WebBrowser1.
View 2 Repliesi follow this script Quote:
[Code]...
I have made my program but I want to give users the option of choosing a custom color for text. I have an inputbox that works and then converts it to Color.whatever. But seeing as the user types in what they want and it is not done by the program itself it can throw exceptions.
Dim directresponse As String
Dim actualcolor As String
Dim isgood As Boolean
[code]....
That is my Sub, it will make Color.(userinput) but I need to check if Color.(userinput) is actually a color that VB.NET can understand and add set.
I have tried "System.Drawing.Color" I get told it is a type and cannot be used in this context.use System.ComponentModel.TypeDescriptor to convert it to a color and check if it is real and then set it.