Search:

Type: Posts; User: groston

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thread: Weird error???

    by groston
    Replies
    3
    Views
    264

    Weird error???

    This one seems a bit odd. I am developing a program and most of the time, when run via the debugger, it works just fine. However, on occasion, an ‘InvalidOperationException crossed a native/managed...
  2. Replies
    5
    Views
    557

    Re: Trying to catch an error

    Since the variable DI is used elsewhere, couldn't simply move the line into a Try structure. Did this:

    Dim DI As DirectoryInfo
    Try
    DI = New DirectoryInfo(dirPath)
    ...
  3. Replies
    5
    Views
    557

    [RESOLVED] Trying to catch an error

    I am trying to write a simple program. In this program, I have the following line of code:

    Dim DI As New DirectoryInfo(dirPath)
    The problem is that when running the program, I get the error:
    ...
  4. Replies
    3
    Views
    337

    Re: Why isn't DrawString working?

    It seems that I made a stupid typo and the string was not placed properly. Sorry to have wasted your time.
  5. Replies
    3
    Views
    337

    Why isn't DrawString working?

    I have a Visual Basic Windows form program that works properly. In this program, there is a PictureBox object on the form and I created a Paint event handler for this PictureBox. In the handler, a...
  6. Replies
    3
    Views
    420

    Re: Paint event nto being called - why?

    .paul. - Thanks. For some reason, when I first wrote this a year or so ago, I felt that the approach I had laid out was the proper one, and I had that stuff in a Try structure. I greatly simplified...
  7. Replies
    3
    Views
    420

    Paint event nto being called - why?

    I have a Windows form program that gets some XML data from the cloud (more on this below), processes in, then modifies the form to display the data (via the Paint event which makes sense and which...
  8. Replies
    8
    Views
    674

    Re: Showing text over an image

    Thank you. Drawing the text in the Paint event handler of the PictureBox seems like the better approach. I have been doing some searching and I see how to add a Paint handler tot he form, but not to...
  9. Replies
    8
    Views
    674

    Showing text over an image

    I have a Windows Form Application written using Visual Basic. I am trying to put an image onto the form, using a PictureBox control and then write some text over the image using a Label control. I...
  10. Replies
    9
    Views
    519

    Re: Getting a Label control's text to update

    I think I now know why I was doing this wrongly: I drew a few lines in the form and had to do that from the Paint event and then tries to do everything else from there. Working much better now - just...
  11. Replies
    9
    Views
    519

    Re: Getting a Label control's text to update

    I am not an expert when it comes to 'graphics' programming. In my app, I need to update the text field of some Label controls and some images in Image controls. Based on my 'deep' research, it seemed...
  12. Replies
    9
    Views
    519

    Re: Getting a Label control's text to update

    Thanks for the reply. I create the Label at run time because that way, I know that I can get the exact placement that I want. Not sure why you mentioned Textbox - it is a Label control with which I...
  13. Replies
    9
    Views
    519

    Re: Getting a Label control's text to update

    Damn - I just tried this simplified code and it works - kinda. The time is being shown, but not in the Label control.
  14. Replies
    9
    Views
    519

    Getting a Label control's text to update

    I am working on a small application that includes several Label controls and I would like to update the text in these controls. Thus far, the only things that works is to delete the control, then...
  15. Replies
    3
    Views
    406

    Re: Getting a directory listing

    Good call. Here’s a simplified version of my code:


    Sub Main()
    Dim DI As New DirectoryInfo(basePath)
    Dim allItems() As FileSystemInfo = DI.GetFileSystemInfos()
    Dim...
  16. Replies
    3
    Views
    406

    Getting a directory listing

    I know that I can use GetFiles to get a listing of the files in a directory. However, this command seems to just return a collection of strings with the file names. What command can I use that will...
  17. Thread: Form sizing

    by groston
    Replies
    1
    Views
    413

    Form sizing

    I am trying to create a form with a PictureBox of known size. I ran into problems, so I created a super-simple program to test things. First, I created a form and gave it a specific size. I also set:...
  18. Replies
    9
    Views
    746

    Making the Paint routine fire?

    I am writing a simple Visual Basic application. The application create a form, and in the form_Load routine, another subroutine is called. The subroutine is defined using Async because ‘Await’ is...
  19. Replies
    15
    Views
    1,629

    Re: Navigating an XML structure - please help

    Problem solved: Replace elemForecast.Descendants with elemForecast.Elements.
  20. Replies
    15
    Views
    1,629

    Re: Navigating an XML structure - please help

    Good idea, but I got the same error. I expanded elemTime.Attributes("from") in the debugger, and the Value was XmlQuery. I clicked the + and saw Name: Results, Value: Expanding will process the...
  21. Replies
    15
    Views
    1,629

    Re: Navigating an XML structure - please help

    .paul - thanks for the prompt reply, but it didn't work. When the marked line was hit the second time, I got the error "Object reference not set to an instance of an object."
  22. Replies
    15
    Views
    1,629

    Re: Navigating an XML structure - please help

    I believe that I am making some progress. I tweaked the code provided to this:


    Dim elemWeather As XElement = myDoc.Root
    Dim elemForecast As XElement =...
  23. Replies
    15
    Views
    1,629

    Re: Navigating an XML structure - please help

    Tewl: Thanks. I tried your code and it worked, but only kinda. When I did not include the code for finding the temperature, the code looped through the entire XML. However, once I added the...
  24. Replies
    15
    Views
    1,629

    Navigating an XML structure - please help

    I am writing what should be a simple Visual Basic program, but I am having trouble navigating an XML structure. In my code, I have some lines that retrieve XML from a website in the form of a string...
  25. Replies
    1
    Views
    445

    Accessing elements of an object

    I am building a simple Visual Basic program, for personal use only, that shows some basic weather forecast information. I did some looking around and decided that 183469is my best option for getting...
  26. Replies
    8
    Views
    938

    Re: Can this be made 'cleaner'?

    peterst: Doesn't work because of the need to do_stuff. Basically, the Exit For would make everything execute the do_stuff

    si_the_geek: Yes, I had figured out your approach and it works, but I was...
  27. Replies
    8
    Views
    938

    Can this be made 'cleaner'?

    I have some code, which simplified looks like this:


    for i = 1 to n
    For j = 1 To limit
    If test_is_false Then GoTo False_Test
    Next j
    <do stuff> ' because test was true limit times...
  28. Re: Question: Creating a two-dimnesional array on the fly

    jmcilhinney - you nailed it, thanks!

    In case anyone cares, to access the members of listOfItems, use the format listOfItems(i)(j) because the typical format listOfItems(i,j) doesn't work.
  29. Re: Question: Creating a two-dimnesional array on the fly

    jmcilhinney - thanks for asking. Here is the program:


    Module Module1
    Public Iterator Function FindCombosRec(ByVal buffer As Integer(), ByVal done As Integer, ByVal itemFirst As Integer,...
  30. Re: Question: Creating a two-dimnesional array on the fly

    I spoke too soon. I thought this worked, but when I tried it again later, the same issue as before!

    Here is exactly what is happening:

    I put a break point on the .Add line
    I click the Start...
  31. Re: Question: Creating a two-dimnesional array on the fly

    Maybe I wasn't clear, my apologies. Per the comment by passel, I tried using a list, see entire program below (and the first two functions were copied):


    Module Module1
    Public Iterator...
  32. Question: Creating a two-dimnesional array on the fly

    I copied some code from an on-line source and it works great. However, I believe that my method of implementation is not ideal and am hoping that you can help.

    What I would like is an array of...
  33. VS 2012 Re: Bitmap.Save - how do I overcome an InteropServices.ExternalException error?

    OptionBase1 - Good idea, but I did as you suggested and got the same error...
  34. VS 2012 Bitmap.Save - how do I overcome an InteropServices.ExternalException error?

    Following is a very simple program, extracted from my 'real' program. that demonstrates the problem. (For those interested, the jpg file is of dimension 200x200 - any jpg will work.) When I run the...
  35. Replies
    1
    Views
    563

    Re: Changing app.config file

    Sorry - coding error - works as expected.
  36. Replies
    1
    Views
    563

    [RESOLVED] Changing app.config file

    I have written a program and to make it more user friendly, I decided that instead of 'hiding' a value in the file <progname>.exe.config, I would put a fake value in said file and if the program sees...
  37. VS 2012 How to delete a jpg file that was just created?

    I have a program that creates a number of jpg files and then combines them into one file. This all works great. The problem is that the code I added to delete the jpg files does not work and, even...
  38. Replies
    3
    Views
    693

    VS 2012 Re: Need help rewriting a jpg save

    .paul - thanks, but with the change you suggested, the failure mode is the same.
  39. Replies
    3
    Views
    693

    VS 2012 Need help rewriting a jpg save

    My code, very simpleminded, looks like this:



    Dim bmp As Bitmap
    Dim bmpSave As Bitmap

    bmp = drawImage() ' function than returns a bitmap

    If something Then
  40. Re: Cannot resolve error message regarding "Expression is a value.."

    Thanks! Had to change the Dim in the structure definition to Public, but then everything worked.
Results 1 to 40 of 71
Page 1 of 2 1 2



Click Here to Expand Forum to Full Width