User Profile

Collapse

Profile Sidebar

Collapse
R MacDonald
R MacDonald
Last Activity: Aug 29 '11, 08:34 AM
Joined: Mar 5 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hello, samvb,

    The MouseClick event provides a MouseEventArgs argument (e) which in turn provides properties e.x and e.y that indicate the location where the click event took place. You could pass this information to the RichTextBox's GetCharIndexFro mPosition method to get the index of the character where the user clicked. Using this as a starting point, then search both backwards and forwards through the Text to find the boundaries...
    See more | Go to post

    Leave a comment:


  • Hello, Nagarajan,

    Here is a simple example. I hope this gives you an idea about how to proceed.

    Dim xlaTest As New Excel.Applicati on
    xlaTest.Visible = True
    Dim wbkTest As Excel.Workbook = xlaTest.Workboo ks.Open("D:\Tes ts\VB Trials\ExcelTes ts\TestWorkbook .xls")
    Dim wshTest As Excel.Worksheet = DirectCast(wbkT est.Worksheets( "Sheet1"), Excel.Worksheet )...
    See more | Go to post

    Leave a comment:


  • R MacDonald
    replied to Key Press on Form
    Hello, Karl,

    The problem here is that the event handler fires for each key pressed. That is, it fires once when the shift key is pressed. Then e.KeyCode is Keys.ShiftKey. Next it fires when the "W" is depressed. Then e.KeyCode is Keys.W. e.Keycode can't be both at the same time.

    Just change your If statement to read:
    If (e.KeyCode = Keys.W AndAlso e.Modifiers = Keys.Shift) Then

    and...
    See more | Go to post

    Leave a comment:


  • Hello, charie ty,

    I am very sorry to tell you, but I believe that it is not possible to do directly do what you are asking. Access does not provide any "back door" that will allow you to reset a user's password. I think that your only options are:
    • Tell the user, "Sorry. Be more careful next time.
    • Record the user's password in your own list when they create or change it. (Of course, this list should be encrypted.)
    ...
    See more | Go to post

    Leave a comment:


  • Hello, ninodgg,

    You can use:

    Me.Controls("Tx tBox1").Text = "hello"

    to do this.

    Cheers,
    Randy
    See more | Go to post

    Leave a comment:


  • R MacDonald
    replied to Ending An Excel Process
    I think that you are experiencing an "implicit reference" problem. If you don't assign an object created by an Office application (such as Excel) to an explicit variable, then an implicit variable is created for that object. This implicit variable continues to exist until the application itself is closed.

    To solve this problem, search through the code in the section "'do stuff with excel app class instance" for...
    See more | Go to post

    Leave a comment:


  • Hello, Anamaria,

    It might be helpful if you could tell us how you are displaying the form (window) from P2.

    But, I wonder if instead of SetWindowPos, have you tried using Me.BringToFront ?

    Cheers,
    Randy
    See more | Go to post

    Leave a comment:


  • Hello, John,

    Is it possible that the error message is not a consequence of the space in the file name?

    Perhaps if you could post a larger snippet showing both the calling and the called code someone would be able to provide assistance. Also indicating the exact line on which the error occurs would be helpful information.

    Cheers,
    Randy
    See more | Go to post

    Leave a comment:


  • Hello, John,

    The Thread.Start method can take a parameter that will be passed to the routine being started. For example, you could pass in the value of your loop iterator (that is "i") and use this to modify the names of the temporary tables and CSV files.

    Cheers,
    Randy
    See more | Go to post

    Leave a comment:


  • Hello, bdmir,

    The problem is probably happening because the screen (user interface) cannot update until the code in the form finishes. The usual way to handle this is to use a separate thread for executing the long running procedure. Look up "BackgroundWork er" in the Help index and see if you can make use of that for this application.

    Cheers,
    Randy
    See more | Go to post

    Leave a comment:


  • Hello, priyamtheone,

    This is a problem that occurs because of an implicit reference to Excel. The application holds on to this reference until it closes. In your case, I believe that you can fix the problem by using an explicit reference within the "offending" lines. Here is an example:

    Code:
                '***** The problem doesn't occur if the following two lines are not used ***** 
                Dim ColumnCollection
    ...
    See more | Go to post

    Leave a comment:


  • Hello again, Perry,

    Incidentally, I should have also mentioned that when you have multiple projects within your solution, you can define solution configurations which specify different project configurations. That is, I can create a new configuration (called "MyMode", for example). Then in the "Solution Properties" dialog, by selecting "Configurat ion Properties+Conf iguration" in the left hand panel,...
    See more | Go to post

    Leave a comment:


  • Hi, Perry,

    Re: "am I right to presume that..."

    No, that's not quite correct and so may be the source of the problem. You can run the code from the IDE in either DEBUG mode or RELEASE mode. And likewise, you can install and run either the DEBUG build or the RELEASE build outside of the IDE.

    Which mode is being used is most easily controlled by using the "Solution Configurations"...
    See more | Go to post

    Leave a comment:


  • Hello, P:od,

    In the IDE you can select either Debug mode or Release mode. (Actually, if the spirit moves you to do so, you can define other modes as well. But Debug and Release are provided by default.)

    Select the Project+Propert ies menu item and choose the "Compile" tab from the tabs on the left hand side of the display. Select "Debug" from the "Configurat ion" drop down at the top left....
    See more | Go to post
    Last edited by R MacDonald; Apr 15 '11, 12:03 AM. Reason: Extend the explanation.

    Leave a comment:


  • Hello, Doug,

    From the message, it sounds like .Cells(0) is returning a value of type DataGridViewTex tBoxCell. So try changing the declaration of ch1 to that type. That is:

    Dim ch1 As New DataGridViewTex tBoxCell()

    Cheers,
    Randy
    See more | Go to post

    Leave a comment:


  • Hello, joncb,

    There are a couple of possibilities. You could just list all of your PictureBoxes in the Click event handler. That is:
    Private Sub CommonPictureBo x_ClickHandler( ByVal sender As System.Object, ByVal e As System.EventArg s) _
    Handles PictureBox1.Cli ck, PictureBox2.Cli ck, PictureBox3.Cli ck, PictureBox4.Cli ck, ...
    Dim pbxSender As PictureBox = DirectCast(send er, PictureBox)
    ...
    See more | Go to post

    Leave a comment:


  • Hello, Neal,

    You say this is your first quarter programming, which leads me to believe this is some sort of assignment that you are working on to learn about jagged arrays. If that is so, OK. But if you don't need to use jagged arrays for pedantic reasons I would not have chosen them to store data for this type of application. Without knowing more details about the requirements, I would have probably created a class structure with...
    See more | Go to post

    Leave a comment:


  • Hello, Neal,

    It is difficult to tell for certain because the declaration of g_decChargesArr ay is not shown in the code that you have posted. Based on the prefix of its name, I guess that this is a global variable declared in some module. Just based on the name, I suspect that the elements of this array are required to themselves be decimal arrays. But you are trying to assign a scalar value.

    Find the declaration for...
    See more | Go to post

    Leave a comment:


  • Hi, MFSPZ,

    I'm sorry about the lack of formatting in the code in the above sample. It seems that all formatting gets stripped away when I post to the thread. Perhaps there is a way to avoid this. But I'm a newbie here and if there is a way I haven't yet learned how.

    Cheers,
    Randy
    See more | Go to post

    Leave a comment:


  • Hello, MFSPZ,

    RPT1 is a function of the parent class. See the sample below for an example of calling Hd from within RPT1. Since your sample Hd function doesn't actually do anything, I have added a Debug.PrintLine statement to it to illustrate the result. I have also appended Button1_Click code to demonstrate how the Hd function can be invoked, first from within the RPT1 method, and then directly. Please see below.

    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...