• 0

VB coding error


Question

I have a problem with visual basic 2010, I am making a tabbed web browser and I put this for the code for new tab:

Dim i As Integer = 1

If Not TabControl2.TabPages.Count = 1 Then

End If

TabControl2.TabPages.RemoveAt(TabControl1.SelectedIndex)

TabControl2.SelectedTab(TabControl2.TabPages.Count - 1)

i = i - 1

And this comes up when I press debug:

Error 1 Property access must assign to the property or use its value.

I need some help, I not very good at this, I'm just getting my codes off youtube for now until I learn the code.

Link to comment
https://www.neowin.net/forum/topic/892314-vb-coding-error/
Share on other sites

12 answers to this question

Recommended Posts

  • 0

I have another error in my tabbed web browser:

Here is the Code:

Private Sub Loading(ByVal sender As Object, ByVal e As Windows.Forms.WebBrowserProgressChangedEventArgs)

ToolStripProgressBar1.Maximum = e.MaximumProgress

ToolStripProgressBar1.Value = e.CurrentProgress

End Sub

Here is the error:

Value of '-1' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.

Parameter name: Value

  • 0

Right, but like people are saying, you need to take a few steps back and learn the fundamentals of the language first, instead of just diving in at the deep end. People could tell you how to do every little basic thing, but that's not very constructive. They aren't telling you this to be mean.

In this case, -1 probably means the operation is complete or failed or something. You need to handle this as a special case.

  • 0

You laugh, but we find the two questions to be very simplistic. Utilizing simple troubleshooting and validation should help you resolve this and future problems. You cannot learn or become better without the skill of knowing how to spot your own errors. Just a thought.

  • 0

Well, what were you expecting it to do? -1 is an invalid value for the progress bar, so what were you expecting it to do other than give an error? You need to compare the value of e.CurrentProgress to -1 and NOT set the progress bar if it's -1, or remove the progress bar or whatever you want to do as -1 seems to mean that the download has finished according to the documentation.

I'm guessing your next question will be how to compare the value. That's why I said you need to take a step back. You need to know the basics first.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Gemini CLI brings AI smarts to your Firebase terminal experience by Paul Hill Google has added its Gemini AI model directly into the command-line interface of Firebase Studio, its cloud-based IDE that uses AI to help with projects. The Gemini Command Line Interface (CLI) means that developers can expand past using AI for code, they can now also use AI for content generation and research without leaving the IDE. Gemini CLI comes with free usage tiers (60 model requests per minute, 1,000 requests per day with a Google login), it offers advanced AI features, and includes integrated Google Search for real-time content. Gemini CLI is also open source so it can be customized and accepts contributions. Accessing the Gemini CLI within Firebase Studio is straightforward, just press “Code view” in the top-right. From there, open up the terminal from the burger menu then select Terminal and New Terminal. Then in the terminal, type gemini and go through the setup, you can just press enter twice to get started. Out of the box, you’ll be able to get started with Gemini 2.5 Pro by just typing a query and pressing enter. There is also a non-interactive mode that’s useful for scripting and automation. To use it you use the –prompt or -p flags followed by your query wrapped in quotes, for example: gemini -p “What is the capital of France?” In this mode, Gemini CLI automatically closes after completing the request. During setup, there was the option to choose a theme. If you ever want to change it or look at other settings such as usage states, tool access, or checkpointing, you can edit them via .gemini/settings.json. You can also add API keys or choose different models in .env and you can using GEMINI.md to provide project-specific context, instructions, and coding styles in Gemini for a more tailored response. With Gemini CLI, you can have it explain code, refactor code, debug errors, and summarize information. It’s as simple as typing explain [file], refactor , debug “Error message”, or summarize “topic”. There are also built-in commands for managing the session such as /help for a command list, /chat to save and resume conversations, /tools to see available tools, and /restore to undo tool-made file edits. Firebase Studio, in true Google fashion, is a cloud-based IDE used in your web browser, making it excellent for weaker computers. To get started, you can head to the Firebase website. From there, tap Studio in the top-right.
    • I would prefer local ai over online ai on some tasks . They are good enough for tasks like artificial voice , image editing , text corrections , tagging etc . Local AI on Windows Photo editor is impressive for example . There are probably many other Ai that we could run on simple pc with GPUs .
    • oh look, we are under the control of the U.S again, is it not about time we as a country did this ourselves if they want it, not rely on greedy U.S. tech companies? We are capable of doing so as a country. I hate how the U.K have gone with no industry like we used to have and relying on other countries. Maybe we should follow Trump words, and make Britain great again and stop bending over to please Trump and other countries. Our government is Trumps puppet. I know we need to co-operate on some things, but come on.
    • Actually I see no problem is notifying readers in advance. The post author mentioned that it'll be available on July 22.
  • Recent Achievements

    • Week One Done
      MIghty Haul earned a badge
      Week One Done
    • One Month Later
      MIghty Haul earned a badge
      One Month Later
    • Collaborator
      KD2004 earned a badge
      Collaborator
    • One Month Later
      ataho31016 earned a badge
      One Month Later
    • One Month Later
      Delahenty Machinery earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      592
    2. 2
      Michael Scrip
      200
    3. 3
      ATLien_0
      192
    4. 4
      +FloatingFatMan
      140
    5. 5
      Xenon
      127
  • Tell a friend

    Love Neowin? Tell a friend!