Search:

Type: Posts; User: coffent

Page 1 of 2 1 2

Search: Search took 0.04 seconds.

  1. Replies
    10
    Views
    1,207

    VS 2022 Re: Error using My.Computer

    Thanks paul and jmcilhinney for your helpful responses. I'll have to rethink how I want to do this (as a very amateur programmer).
  2. Replies
    10
    Views
    1,207

    VS 2022 Re: Error using My.Computer

    Thanks. Yes that works. However I now have another problem. I believe the following statement works under .NET Framework 4.8:


    My.Computer.Keyboard.SendKeys("x{ENTER}", True)

    The Microsoft...
  3. Replies
    10
    Views
    1,207

    VS 2022 Error using My.Computer

    With a Console Application with target framework .NET Framework 4.8 a statement of the form


    My.Computer.FileSystem.WriteAllText(...)

    works fine. But with one with target framework .NET 7.0 I...
  4. Replies
    6
    Views
    1,729

    VS 2022 Re: Using Clipboard in .NET 7.0

    Of course! I was creating the project as a Console App, not a Console App (.NET Framework). When I switched to the latter, everything worked fine. Dumb mistake! Thanks all for your help.
  5. Replies
    6
    Views
    1,729

    VS 2022 Re: Using Clipboard in .NET 7.0

    Thanks for the suggestion. I tried
    Dim text as String = My.computer.clipboard.gettext() and still get an error message,
    'computer' is not a member of 'Test.My' (where "Test" is the name of the...
  6. Replies
    6
    Views
    1,729

    VS 2022 Using Clipboard in .NET 7.0

    As a very occasional and self-taught programmer, I've written apps under .NET Framework 4.7.2. To use the statement

    Dim text as String = Clipboard.GetText()

    under that framework it's...
  7. Replies
    3
    Views
    1,595

    Re: COM port number keeps changing

    Thanks for the suggestion. The discussion you referred me to mentions that SerialPort.GetPortNames points to HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM. Checking that, I found that indeed it...
  8. Replies
    3
    Views
    1,595

    COM port number keeps changing

    I have a soft modem that I access through a vb program. The following code snippet

    Dim sp1 as String
    For Each sp1 In My.Computer.Ports.SerialPortNames
    Debug.Print(sp1)
    Nextfinds 1 port,...
  9. Replies
    6
    Views
    1,619

    Re: RandomNumberGenerator.GetInt32 doesn't work

    Finally got it! Thanks.
  10. Replies
    6
    Views
    1,619

    Re: RandomNumberGenerator.GetInt32 doesn't work

    Thanks to you both.

    Visual Studio 17.4.2; Framework 4.8.04084

    As a newbie to this, I'm hoping one of you could post a code snippet showing how I should proceed. Thanks!!
  11. Replies
    6
    Views
    1,619

    RandomNumberGenerator.GetInt32 doesn't work

    Imports System.Security.Cryptography
    Module Module1
    Sub Main()
    Dim rng As RandomNumberGenerator = RandomNumberGenerator.Create()
    Dim n As Integer = rng.GetInt32(10)
    End...
  12. VS 2022 Re: Program plays a .wav sound file on my desktop but not on my laptop

    Thanks for your responses. I've found the problem, something I should have checked before. The .wav file I was trying to play is very short - ~50 ms. This plays fine on my desktop, but apparently...
  13. VS 2022 Program plays a .wav sound file on my desktop but not on my laptop

    I've written a program in Visual Basic that, among other things, plays a .wav sound file. It works as expected on my desktop computer. When I put the executable on my laptop where Visual Studio is...
  14. Re: How to change the color of points plotted in a Point SeriesChartType?

    Thanks. I'm part-way there. When I add the statement you suggested (using () rather than []) the point color changes from gold to blue, not red. I've added the following test code:

    ...
  15. How to change the color of points plotted in a Point SeriesChartType?

    I've created a chart and defined a series as:


    Dim series1 As New DataVisualization.Charting.Series
    series1.ChartType = DataVisualization.Charting.SeriesChartType.Point

    This works but I'd...
  16. Re: How to ensure that a form is displayed on top?

    Thanks, Amerigoware. I've added your suggestion to my collection of code snippets in case I run into a similar problem. I discovered later in the case I asked about that the problem had nothing to...
  17. Re: How to ensure that a form is displayed on top?

    Thank you.
  18. How to ensure that a form is displayed on top?

    I have a vb program that reacts to an event (a signal from a modem) by displaying a form. I have the following (simplified) code:


    Public Class MainForm
    Dim eventOccurred As Boolean =...
  19. Re: Identical Split() call works fine in one program but not in another

    Thanks for the information. I wasn't sure what the difference was in the two calls (not only for Split but for other functions as well). I'll follow your advice.
  20. Re: Identical Split() call works fine in one program but not in another

    Yes! Removing "Imports System.String" fixed the problem. I'm actually not sure why I had it there in the first place. Thanks!
  21. Re: Identical Split() call works fine in one program but not in another

    Thanks for the reply, but I'm afraid I don't understand. The first version does have two parameters: "ab-c-d" and "-". The second, as I said, was copied directly from an example shown on a...
  22. Identical Split() call works fine in one program but not in another

    I have a test line in a VB program:

    Dim testArray() As String = Split("ab\c\d", "\")
    which I copied more or less straight from a Visual Basic reference.

    It works fine in one program, but in...
  23. Replies
    10
    Views
    2,094

    Re: [RESOLVED] Problem displaying a second Form

    Done. (BTW, I wanted to rate your replies (high) but I have first to "spread some Reputation around".)
  24. Replies
    10
    Views
    2,094

    Re: Problem displaying a second Form

    Thanks - that cleared everything up.

    Also, I found code tags, for next time.:)
  25. Replies
    10
    Views
    2,094

    [RESOLVED] Problem displaying a second Form

    Here is a toy program that illustrates my question:


    Public Class Form1
    Sub Form1_Load() Handles Me.Load
    Dim form2In As String = ""
    Form2.Show()
    'How do I wait for...
  26. Replies
    7
    Views
    2,136

    VS 2019 Re: How do I open a class's code editor?

    OK, thanks - I finally understand! Thanks everyone for your patience!
  27. Replies
    7
    Views
    2,136

    VS 2019 Re: How do I open a class's code editor?

    Sorry, but I still can't find it.
    182404
    The only option I see at the top left is the icon "VB". It shows in 3 columns the project name, the form name, and in a dropdown menu, "contextMenu1". But...
  28. Replies
    7
    Views
    2,136

    VS 2019 Re: How do I open a class's code editor?

    Thanks, passel, for your reply.

    I suspected that what was meant was just the Visual Studio editor, but I'm still missing something that's probably very obvious.

    The Help says "As soon as you...
  29. Replies
    7
    Views
    2,136

    VS 2019 How do I open a class's code editor?

    Very basic question: A Microsoft help page* says,

    As soon as you declare a variable using WithEvents, the variable name appears in the left drop-down list of the class's Code Editor.
    When you...
  30. Replies
    3
    Views
    884

    Re: How to retarget .NETFramework?

    Right-clicking worked. As you pointed out, jmcilhinney, I should have tried that, but somehow it slipped my senescing mind. Apologies for impelling you to reply.
  31. Replies
    3
    Views
    884

    How to retarget .NETFramework?

    When I loaded an old project, I got the message "The VB project {name} is targeting ".NETFramework, Version=4.0, which is not installed on this machine. To proceed, select an option below." I chose...
  32. Replies
    4
    Views
    1,485

    VS 2019 Re: How to run a jar file?

    Thanks for the info. I'll use that instead.
  33. Replies
    4
    Views
    1,485

    VS 2019 Re: How to run a jar file?

    Thanks - that fixed it! The only problem was the space between "-" and "jar". The Shell statement now works, though I'm wondering if there is some advantage in using the Process.Start command...
  34. Replies
    4
    Views
    1,485

    VS 2019 How to run a jar file?

    I am trying to run a jar file with a target using: Shell("java - jar {path1}File.jar {path2}TargetFile")

    From a command prompt, when I run {path1}File.jar...
  35. Replies
    4
    Views
    1,705

    Re: Error message with String.Contains Method

    Thanks for the information and the work-around, which solved my problem. As you guessed, the program targets .NET Framework 4.7.2.

    Also, I've set the default to Option Strict On. :-)
  36. Replies
    4
    Views
    1,705

    Error message with String.Contains Method

    Microsoft Docs for "String.Contains Method" says an overload is "Contains(String, StringComparison)". Yet when I try

    Dim comp As StringComparison = StringComparison.OrdinalIgnoreCase
    Dim str...
  37. Replies
    7
    Views
    4,727

    Re: Can't access a mapped drive

    It appears I must have, even though I didn't think so. I remapped the drives being sure I was *not* an Administrator, and now VB runs under User mode. Thanks.
  38. Replies
    7
    Views
    4,727

    Re: Can't access a mapped drive

    Thanks for your reply. As I said, I think I've solved the problem by simply running VB as an Administrator. Why that should be necessary I don't know (but there are many things about Windows I...
  39. Replies
    7
    Views
    4,727

    Re: Can't access a mapped drive

    I finally solved the problem by running Visual Studio as Administrator. I don't know why this is necessary, and if anyone has an explanation I'd be glad to see it!
  40. Replies
    7
    Views
    4,727

    Re: Can't access a mapped drive

    Thanks - one problem solved. Now for the other one :)
Results 1 to 40 of 75
Page 1 of 2 1 2



Click Here to Expand Forum to Full Width