Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

My last (ever) boss told me "you're going to get sh!t no matter what you do" so experience taught me to do it my way. What he actually meant was "I'm going to give you sh!t no matter what you do" so, yes, he was close to being the worst boss ever. Fortunately my users were a different breed entirely.

You get better with experience if

  1. you have the capacity to improve
  2. you are willing to learn from your mistakes
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

your comments are always always always rude to me!

For most of my career there was no internet. When I didn't know how to do something I was expected to figure it out for myself. I couldn't go out and just buy a book because:

  1. There wasn't as much published information as there is now
  2. Books are expensive and I wouldn't know which one, if any, would have the information I needed

I would have killed for the resources available on the internet that we have today. Doing a Google search takes seconds. Even if the information is not available in one location, I can generally figure out how to do something by checking several search results and then experimenting. Most of my questions consist of either "is this possible" or "I'm stuck on this one little detail". In a lot of cases, just knowing something is possible is sufficient. I get very annoyed with people who are too lazy to put in the effort and want to have their hand held through every step of the process.

If you are educated enough to put yourself into the workforce (as your job with Samsung would seem to indicate) then you should have the chops to not need this step-by-step guidance.

nitin1 commented: you were correct, you are correct, you will always be correct. only one hell is wrong is here , any guesses ? no ? it is nitin. ;) enjoy!! +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You want us to hold your hand through the process of learning how to use someone else's website? I think that is asking a bit much.

nitin1 commented: your comments are always always always rude to me! don't know why are you like this to me ? still a up-vote because people here will not say anything to you, no matter how worse you are with me :-D +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can do it by

Private Sub ListBox1_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseMove

    Dim G As System.Drawing.Graphics = Graphics.FromHwnd(Me.Handle)
    Dim item As String

    item = ListBox1.IndexFromPoint(New Point(e.X, e.Y))

    If item >= 0 Then
        TextBox1.Text = ListBox1.Items(item)
    End If

End Sub
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I have to highlight and find the texts of controls pressing F4 for my further use.

Apparently I have no idea what you are trying to do and you don't seem to want to answer my question. I suspect we are having a language problem.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

No big developers. Check my profile.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Doh! Time for new reading glasses. Either that or stop posting at 3:00 am

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Please post the actual string value of SQLTambah so we can see the query you are running.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I first learned FORTRAN (WATFOR) followed by PL/1, APL, COBOL, 360 Assembler, SNOBOL and ALGOL. The only ones I actually used following graduation were FORTRAN, APL, PL/1 and Assembler although the Assembler(s) I actually programmed in were DEC, Data General, GE, 8080 and SEL (Westinghouse). Fortunately I never had to program in COBOL. I also programmed a lot in C and VB, both of which I learned on my own.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Definitely java for the jobs but I urge you to learn Python if only because the language is so much different than C++ or java and it would do you good to learn to think about programming in a different style. I learned 7 programming languages back in my university days and it was a great experience.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I replaced the tabs with spaces and now everythng lines up.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

And I'm still missing something. If the control already has focus then it is already highlighted in which case you don't need to press F4. You did originally say

when I click on textbox1 and then press F4

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You can use AddHandler for that. For an example please see Create controls at runtime with events. Even though you aren't creating the controls at runtime it still shows how to use addhandler. And if you want to add all of the textboxes you can do

Public Class Form1

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        For Each tbx As TextBox In Me.Controls.OfType(Of TextBox)()
            AddHandler tbx.GotFocus, AddressOf TextBox_GotFocus
            AddHandler tbx.LostFocus, AddressOf TextBox_LostFocus
        Next

    End Sub

    Private Sub TextBox_GotFocus(sender As Object, e As System.EventArgs)

        Dim tbx As TextBox = sender
        tbx.Tag = tbx.BackColor
        tbx.BackColor = Color.LightBlue

    End Sub

    Private Sub TextBox_LostFocus(sender As Object, e As System.EventArgs)

        Dim tbx As TextBox = sender
        tbx.BackColor = tbx.Tag

    End Sub

End Class
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Note that not only is my alignment changed, but the first line is also indented differently. And if I reload the page it changes again.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'll try to attach two partial screens. One is while I am in edit mode and the other is after I post/save.
d755f00759220578022341583fb3e8bcd755f00759220578022341583fb3e8bc55c148f4a1563c914c7fa39c455a2608

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I added a code snippet today but no matter how I format the code it still screws up the indentation. See here. I'm trying to line up the continued lines.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The pop-up display for endorsements does not reflect the actual number. I have 19 vb.net endorsements but the pop-up on the vb.net forum shows 18.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Ah. My mistake.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Interesting. I went to the chat window and it showed the following users

Reverend Jim
deceptikon
stbuchok
Dani
JorgeM
mike_2000_17
ehpratah

but all of the listed chats showed 0 chatting

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That's what I did in my example above. When the control gets focus (Enter), the current BG colour is saved in the Tag property and the BG colour is set to a highlight colour. When the control loses focus (Leave) the original BG colour is restored.

when I click on textbox1 and then press F4

I don't understand the purpose of pressing F4. If you click on the textbox it gets focus. Why do you need to press F4? Your original post was confusing. What do you want to happen when F4 is pressed?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I had suggested making the Related Articles panel sizeable with a Show/Hide gadget like in Google Maps.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I thought the question was phrased awkwardly and I interpreted it in a different way than you did. But if the OP can clarify what types of controls are involved and how the highlighting is to be indicated then I'd be happy to offer a suggestion. For example, if it's only textbox controls then all that has to be done is changing the BG colour. Other controls might require other methods. Better information gets a better answer.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Is mybase the name of the purchase form? If not then you have to have an event handler of the form

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

End Sub

where you replace Form1 with the actual form name as in

Private Sub frmPurchase_Load(sender As System.Object, e As System.EventArgs) Handles frmPurchase.Load

End Sub

If you do have an event handler like that then add

MsgBox("loading purchase form")

and tell us if the message is displayed.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Clicking on a control already sets focus to that control. If you want to do it dynamically you can do something like

TextBox1.Focus()

If you want to attach it to a hotkey then you can set the forms KeyPreview property to True and add

Private Sub Form1_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
    If e.KeyCode = Keys.F4 Then
        TextBox1.Focus()
    End If
End Sub

If you want to highlight the focused control somehow then you'll have to specify how you want it highlighted. If you want to change the background colour of a textbox (for example) then you could add

Private Sub TextBox1_Enter(sender As System.Object, e As System.EventArgs) Handles TextBox1.Enter
    TextBox1.Tag = TextBox1.BackColor
    TextBox1.BackColor = Color.LightBlue
End Sub

Private Sub TextBox1_Leave(sender As System.Object, e As System.EventArgs) Handles TextBox1.Leave
    TextBox1.BackColor = TextBox1.Tag
End Sub
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You could try

Math.Truncate(yournum + 0.5)

and convert it to Int if you require an integer. I hate the way vb does rounding which is different for even numbers than for odd.

Math.Round(6.5) is 6.0
Math.Round(5.5) is 6.0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It's the same as in the reply from Mike.

Ah. INABIAF (it's not a bug, it's a feature). Makes sense now.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Check this. The actual post has the same BG colour as the comment.

(/attachments/large/3/bfc1eda35c38a237bf2ee0449eb0f3ad.jpg "bfc1eda35c38a237bf2ee0449eb0f3ad")

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It's a bit like driving a car. If you are going somewhere familiar you don't really think about what you are doing. If you are going someplace unfamiliar you have to watch for street signs and pay a lot of attention to every turn.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The new page for Unresolved Reported Posts is nice in that I can now edit the reported posts from that page if need be, however, some posts need to be seen in context to be assessed. Unfortunately there is no Jump To Post link. Is that provided by some other link? If so, it is not obvious to me.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

NEW means there are new posts you haven't seen.
READ means you have read (past tense) this thread
ME means you have posted in this thread

<M/> commented: Thank you +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I don't know if this is related to the changes, but I went to my ShoutBox using IE9 but I was unable to submit any text. I could enter the text in the message area but I couldn't get it submitted. I tried using Firefox 23 but I was able to submit only one line before it locked me out.

I saw that someone had been trying to chat (you popped in for a bit as well) but because I was not monitoring my ShoutBox I had no way of knowing I was wanted. What is the point of allowing someone to go to my ShoutBox and send messages if there is no corresponding notification to tell me that someone is posting?

And I see my post got half submitted again (IE9). I'll try to post a screenshot with this post.

83ada561e4a5c54db8469b810f9b8fb9

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I tried to upload a file using Firefox v23. I had to clear the cache before the browse buttons would render. But after sselecting the file I got no placement options so I had to cancel. I tried IE 9 and was able to attach the file but there were other problems. Here are the steps in both browsers

Click Files

Browse buttons appear above the message box.

Click Browse

Browse dialog appears. Select file and click OK

Dialog closes. File name is in textbox to the left of the browse button but no placement options are shown.

Now as I am making this post I clicked Submit your reply and I was taken back into edit mode and the Submit your reply button disappeared. I had to copy the text into the clipboard to avoid losing it, close the page and reload it, then resubmit the post.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Conway's game of Life in one line of APL

c0c8e8bfe2c42cb379b0068a0533673a

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you care to hear one more comment, the Related Articles section takes up almost a third the width of my screen. This means that more code lines get wrapped. Would it be possible to add a gadget (like on Google Maps) that would collapse the Related Articles pael?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If code is hard to read it ie either because of

  1. the language
  2. the programmer

Some languages (APL, Perl) make it very easy to write unreadable code. Other languages make it slightly less easy but a programmer who lacks a decent style will write difficult-to-read code regardless of whatever syntax highlighting is available. I expect that providing a parser for all the languages for which separate forums exist would not be worth the effort. Well written code needs no highlighting to make it readable. Poorly written code would not be improved by it.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

would have been more realistic (timingwise) if they had compared

If StrTemp = vbNullString

with

If StrTemp = ""

Although I suspect programmers would achieve better results looking for other things to optimize.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Is the code in the ComboBox6_SelectedIndexChanged event handler? If so it should work. It works just fine for me (vb 2010). Iincidentally you can shorten the code to

TextBox10.Visible = (ComboBox6.Text = "Enabled")

You don't need the parentheses but if you leave them out it looks like a multiple assignment.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In vb.net you can treat vbNullString as being equivalent to "" but they are not treated exactly the same. For example, in the following code

Dim s As String = ""

If s = vbNullString Then
    MsgBox("same")
End If

the message "same" will be displayed when run, however, if you put a breakpoint on the End If and open the Immediate window you can get the following results

?s = ""
True
?s = vbNullString
Unable to evaluate expression.

so obviously vb does not quite treat "" and vbNullString equivalently. If you want to know how this is handled in VBA or VB6 then post in that forum.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I can't imagine why you would run into memory problems by just using different colours. Using the same colour for everything or a different colour per area should make no difference to the amount of memory used. For that matter, loading a picture with thousands of different colours into the picturebox makes no difference. Can you post some code?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If someone wanted to give a reason for the downvote they would have given one. If I ever downvote you I promise that I will tell you why.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I don't generally read the fine print. I shoulda.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I gave one well known (at least to Canadian media) where that was the case. I didn't quote a number as to how widespread the practice is in that country. I also did not make any comment on the quality of the engineers who graduated from legitimate institutions in India.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I found that using compressed air on keyboards just drove a lot of the hair (two cats) and lint farther under the keys. Now I use a wide soda straw on the end of a vacuum cleaner.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Can you also post the DDL to create the games table?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I can't speak in general but in Canada it was recently discovered that a number of workers who were brought into the country from India as temporary (then made permanent through a loophole) employees were found to have purchased their credentials rather than earned them through study.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

One way is

For Each item As ListViewItem In ListView1.Items
    item.Selected = True
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In my particular case, the job position I had when I retired was the same one I had when I was hired. My salary, of course, was considerably higher upon leaving. My actual job title was Process Control System Software Specialist and over the years I progressed from level 1 through level 4 (with each level having several salary steps). Because of technology changes my job requirements changed substantially and at every employee evaluation I was asked where I wanted to be in five years. Each time I made it clear that my interests lay in the technical rather than managerial aspects of the job. It wasn't that long before they got the idea that I wasn't interested in anyone else's job. In spite of that, I had to assume a partly managerial position when my group was temporarily divided in 1997-1998. Half of the group was put on the development team to replace our aging AGC/SCADA system. The remainder maintained that old system. When the new system was commissioned I went back to only technical work.

Short version - nobody saw me as a threat.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That code doesn't have anything to do with the code you posted previously so let's just worry about this code.

Dim lines() As String = System.IO.File.ReadAllLines(Destination & "\" & "LineTest_Final.inp")

reads the entire file into an array so you don't need a loop. Likewise

Array.Sort(lines)

sorts the entire array at once so you, again, do not need a loop. Furthermore, you can write the entire array of lines to the file in one line. So the code becomes (I'll just use my local test file names)

Imports System.IO
    .
    .
    .
    Dim lines() As String = File.ReadAllLines("d:\temp\test1.csv")
    Array.Sort(lines)
    File.WriteAllLines("d:\temp\test2.csv", lines)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Post the contents of the input file as well as the output file because running your code against the input you posted at the top of this thread just results in an error. If the output isn't what you want then post what it should look like. Also, I have no idea what you are trying to do based on the code you posted. Also, the comment Here I have the BrachCode and eachline without the serialno as array into mnewline doesn't mean anything to me.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In my job I was always willing (even eager) to show others how do do the things that apparently only I was doing. A lot of that was using vbScript to automate processes by using scriptable components from other applications. Our corporate dbadmin specialist, in particular, was excited to see how I was doing the automation. I believed that I made myself more valuable to the corporation by sharing my expertise rather than by hoarding it.