I am new to programming and am trying to develop a GIS based application. Very simple, I have code to copy text into an attribute table. I have a form which has several option boxes with captions of different attributes, I need to be able to produce a loop code to discover which option buttons value=true and for each of these to store the caption as a string into a predefined string (mytext) seperated by a comma.
In VB6 I could set up code to loop through say 10 option buttons to check their values. The code would be something likie this:[code]But in VB .NET it seems that if I use the Controls command as above I cannot use/check the Checked property as Control does not take that as a property of Control. It seems also that I may have to use the Find property of Control as in "Controls.Find" etc.How can I do this in VB .NET? I have a very control intensive application and I must be able to easily loop through controls and check their values without writing out 10 x the code required.
But adding there code produces loads of errors. Am i for getting to add something? Protected Overrides Sub OnCheckedChanged(ByVal e As EventArgs)example errors remove overrides If Not Checked OrElse Me.Parent Is Nothing Then Returnhecked is not declareParent.Items is not a member of system.windows.forms
The title of our forms is Company Name - Application Name - Form Name This makes selecting the form you want on the TaskBar a bit difficult since the Form Name is not shown. We would like the TaskBar caption to be Form Name - Application Name - Company Name or simple Form Name From my searches, this CANNOT be done except by using an invisible form that displays on the TaskBar which calls the visible form that does not display on the TaskBar.
The programing I am creating requires window captions for SendKeys. Some windows hide their captions and I want to be able to use Spy++ or create my own way of getting the caption. All I want from Spy++ is Finder Tool, is there anyway of just taking that from Spy++ or how would I go about creating it?
I have 20 labels on my Excel VBA user form. I have named them as lbl1, lb2,..... lbl20. I need to set the caption of all the labels retrieving from the excel sheet. for e.g., Dim objthis as object Set objthis=thisworkbook.sheets(1) lbl1.caption=objthis.cells(1,1) lbl2.caption=objthis.cells(2,1) . . so on till lbl20.caption=objthis.cells(20,1)
I felt this was crazy to write 20 lines of code for just captioning labels. If I can write it this way For i = 1 to 20 lbl & i = objthis.cells(i,1) next I know this is incorrect and wont work. May be I am near to finding out the approach or may be its not possible.
I have a piece of software with two tabs, inside each tab there are buttons (the user can add the buttons when they want). when tab1 is full tab2 should start to fill. I currently know how many buttons fit on the screen so I just say something like if buttons > 150 then start to populate tab 2 The problem i have now though is if the resolution is changed then a different amount of buttons can be displayed. so if I put my screen to 1280x720 some buttons are left of. I was thinking of detecting the resolution and then using different cases for different resolutions but this seems very inefficient im wondering if there is a different way?
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.
Using Access 2003 and VB code, I have created a form with a number of labels. The labels will display an employee's names. I have named the labels name1, name2, name3...etc. Using an ADO data set and DCount I have determined the number of names in an Access table (the number of names can vary). What I want to do is for each record in succession to pick the first name and surname from the data set , combine them into a full name (this part has been successful), and then set the full name into the label caption in succession. Example: full name 1 into name1, full name 2 into name2, full name 3 into name3... until all names appear as labels on the form.
I created a counter to and a variable to increment the label number but when I address the caption property of the variable containing the new label (e.g. name1, name2..etc.) it throws an errer at runtime. Here is the code:
what does these two code means in vb.net: Option Explicit on Option strict on i think option explicit means the compiler is not going to do any kind of conversion and i need to do all of them by the code;also it becomes case sensitive i.e;
1. I have read that keeping Option strict on and Option infer off is good practice and will insure your code is tight and properly written. I would like input regarding this, pro's and con's from those who are in the know.
2. Having said that, I have set Option strict on and Option infer off in an existing program I wrote (that was working perfectly mind you) with them off and on respectively. I went through and cleaned up all the errors on the 'need AS' and casting of variables, but one is leaving me a bit put out.[code]
I have also read where using My.Computer.System.Directory.GetFiles() instead of System.IO.Directory.GetFiles() is probably not a good thing, but when I change to this I get no error, but also no dataI am thinking I should stay with the strict on and infer off but am really slogging through getting this code correct.Running Win7 on Dual Quad Core XEON Intel Extreme with 8Gb RAM.
I am writing a text editor program and I have written the new, open, save as, exit menu items but I am struggling with writing the save option.Now I have created the menu itself (well vb did, I just used insert standard items) but how do I code up the save menu option so that it updates the current document or if the documnt has not yet been saved bring up the save file dialog.Here is the code I have so far
Public Class Main Private Sub NewToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripButton.Click, NewToolStripMenuItem.Click[code]....
I know I have some finishing touches such as messages and error handling and stuff but at the moment I want to get all the basics working,I think the save menu option is all I am struggling with at the moment.
Using VS2008, targetting framework 3.5, trying to update some VB4 code. Yes, VB4.I have a bunch of legacy code I'm trying to update, and I had the idea of trying to work through it by executing the old code, working out what was causing each error as I came to it, solving the problem, and then moving on.In order to do this, I have sinned and set Option Strict Off, Option Explicit Off and Option Infer On.Yes, I'm going to hell for this.Problem is, I'm still getthing errors that various things haven't been declared.All of these the items showing errors are in the form: itemName(obj)Is my problem that the compiler thinks that these are method calls for methods which haven't been declared?PS: For anyone wanting to tell me not to use these settings, I already know
What I would like to do is to have four different buttons (e.g., buttonA, buttonB, buttonC and button D). I wanna give the following instruction to the people: press these buttons in the following order: first buttonA, then buttonB, then buttonC and last buttonD. If they obey this instruction then a picture will be displayed, for instance a happy face. All the other combinations will not activate this picture to be displayed, or in other words, there won't be any consequence. I would also like to save this data using windows note pad e.g., writeline (1, xxxxxx). Is there any chance I will make it?
I have to take over a project written in vb.net, which contains more than 400k lines of code written in option strict off mode. I want to build it under option strict on first before I do anything else -- which maybe converting it into C#. I found there's thousands of lines of code raises compilation error, mostly are about implicit type casts. Is there any tool would help to make it compile under option strict on mode if I don't want to correct every single line manually? Because it's really painful to add CStr/CInt invocation into every line of Code myself.
I'm using a dialog form with two buttons and two Radio buttons.I'm oppening this Dialog when a button is clicked on the parent form.My situattion is when the Dialog opens the code in the button event continues to execute, but I only want it to continue to execute only after a button from the dialog form have been clicked
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If multipleEXT = 2 Then Extension.Show()
i need to get some buttons to interact with other buttons on screen when i click then, as each indivual button gives a slightly different result.imagine this:[code]....
then i need then to hide different buttons depending on which button was pressed. so say i pressed button 1 then all the buttons showed but alternativly if i had of pressed 2 then say button 5 and 6 disapear.managed to get one way to work but then i would only ever end up with the first results every time.
My VB application is behaving strangley. I have form with fairly large number of controls. I am using case against radio buttons. after curtain number of buttons, it stops responding to more radio buttons.
Then I tried to split controls in to 2 form but now my form.showdialog() too now working properly. It takes new from names but show the old form when running.
I have 7 Windows forms.The order of the forms is defined within a configuration file.I want to place buttons on each form that will show the next available options.The Next button will move the next form in the list.The Back button will move to the previous form in the list. The Finish button will execute the final piece of code.The Cancel button will exit the application.If the user is on the first form, then there is no Back button.If the user is on the last form, then there is no Next button, but there is a Finish button.
I have inherited a VB.NET application that I need to compile so I can run dorkumentation on it. I first received "Option Strict On disallows implicit conversion from x to y" errors, so I turned off the Option Strict option in the Project file.
So why do I still fail with the same error message?
I have two comboboxes which are related to each other. When a make a choice in the first there are different choices possible in the second. So far so good. But is it possible to remember the second choice when i change the first? the program should select the the option in the second if possible or other select the first option.[code]
Mine is a windows app. containing forms named BOM nd BOMSelected..There is datagridview in BOM which contains checkbox column.. When the user selects checkbox, the selected rows should be seen in the datagridview of other form, SelectedBom..I have coded but don't get it working.. Some error..
Here is what i have done !!
Public Class SelectedBom Private Sub SelectedBom_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'HemDatabase1DataSet4.partno' table. You can move, or remove it, as needed. 'Me.PartnoTableAdapter.Fill(Me.HemDatabase1DataSet4.partno)
I'm building a slot machine, and I'm having some trouble.re's the
'Pulls down the slot If e.KeyCode = Keys.Space Then PictureBox2.Focus()
When I debug and click space down, my picture box of the knob slides on down to 175, pauses, and shoots back up. The problem I'm running into, is that it doesn't do anything if I try to pull the knob down again. It doesn't bug out or anything, but it just doesn't do it again
I'm trying to write a program right now for my computer science class for a program where you insert text into a text box, (the text being a password), and then click a submit button. The goal of the assignment is to have a program that looks at the user given password and see if it matches the const password (or one of the three const passwords in my case). If it doesn't, it is supposed to loop back so you can re-input the password. Also, If you enter the correct password, the loop ends and you are to get a msgbox (or, in my case three different ones), and then the application closes. We are to write the code so that if the password is wrong "x" (insert 3 as the number I have chosen), a MsgBox will pop up with a message saying something along the lines of "you have gotten the password wrong to many times.", and then the application is supposed to close. I don't think I could rant on much more, I've done a good (or in my eyes terrible) job of summarizing the assignment.
My problem (aside from, I don't know, a problem with my code itself) is that when It reaches the loop, it goes through all the code again, but I'm unable to change the user given password, and so it just pops up the three failed password entry MsgBoxes (the code for which is temporarily removed), then the failed to many times MsgBox, OR one of the successful message boxes. What I'm wondering is if anyone can help me fix my code so that it functions as desired.
I have a listbox with SelectionMode = MultiExtended. I am trying to capture all the selected values to end up with 1 variable that includes all the selections in the listbox.I'm getting error "Public member 'Selected' on type 'String' not found." at the start of my If statement
For iLoop = 0 To Me.lstVDN.Items.Count - 1 If Me.lstVDN.Items(iLoop).Selected Then VDN = VDN & Mid(Me.lstVDN.Items(iLoop).Value, 1, 5) & "','" End If Next