 |
| Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET). |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 5th, 2008, 01:35 AM
|
|
Registered User
|
|
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Editing MSFlexGrid in VB6
hi
|
|

April 7th, 2008, 03:22 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
Codes are not things, code is stuff. You donât write âa code.â You write code.
âAs you all know that by default we cannot write in MSFlexgrid.â is not a sentenceâit has too many verbs. It could be either
As you all know, by default we cannot write in MSFlexgrid.
âorâ
You all know that by default we cannot write in MSFlexgrid.
At the end of a sentence, place a period, followed by a space, and start the next sentence with a capital letter.
â . . . cannot write in MSFlexgrid.In order . . . â should be
â . . . cannot write in MSFlexgrid. In order . . . â (an added space)
âthis is how it works.â should be
â [u]T</u>his is how it works.â
âwe drop a text box on the form.now whenever . . .â should be
â [u]W</u>e drop a text box on the form. [u]N</u>ow whenever . . . â (note the space between)
âwe have to then call the required . . . â should be
â [u]W</u>e have to then call the required . . . â
Commas are followed by a space, not preceded by one.
â . . . the grid ,we should . . .â should be
â . . . the grid , we should . . . â
If you precede your code in postings with the word âcodeâ inside [], and end your code with the word âcodeâ in [/], your code will be fixed spacing, and will illok like code. Just to show you (I cannot use the real formatting, or the web page will show you the results, not how to do it) I will spell âcodeâ backward:
Code:
[edoc] Dim A_Var As String[/edoc]
The purpose of this web site is to seek help, not as a publishing forum
|
|

April 7th, 2008, 03:58 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
|
|
Firstly i'm not sure what this post is about, if its information then Brian Wren is correct in that you should make what your saying grammatically correct for ease of use but its not to bad. Secondly Mr Wren, you shouldn't get so wound up by people not posting in good grammer as its not school or a place of learning english, when it comes to it i'm sure the poster can write correctly for it is only a post on a forum, not a place to get scrutinised by other people about spelling and punctuation. And as you well know "illok" is not how you spell "look", if your going to be critising then you better get it correct as well.
|
|

April 7th, 2008, 11:13 PM
|
|
Registered User
|
|
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
mr wren
well i hd no time checking for all dat mistakes. i jst posted mycode.i tried searching on this topic.when i could nt get wht i wanted i came up with my own code.and so posted so that someone else can use.
i guess a rogrammer will only look at my code not my mistakes.
so if u think its causing any problems then i shall remove it and post it in some other forum.
Gaurish Salunke
|
|

April 8th, 2008, 11:22 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
Well, Gaurish, clearly a programmer [u]mi</u>g[u]ht indeed</u> look at more than your code, as clearly evidenced by the fact that 1) I am a programmer (an application developer), and 2) I looked at more than just your code.
I donât think thereâs any reason to remove it, but only to avoid using this forum as a publishing outlet. When you couldnât find what you were looking for, the thing to do would have been to post a question about that. Thatâs the way this site is intended to be used.
But one principle that I try to live by, and to try to encourage others to adopt as well, is to strive for excellence. I donât always obtain it, and therefore am grateful when someone points out to me areas for improvements (especially when how to accomplish that improvement is included).
A site like this one is a professional site (as opposed to something more like a chat room), and so it seems to me that the mode of communication should reflect that.
That means posts that eschew punctuation, or that use all lower case (or all upper case) would be inappropriate. As professionals communicating with professionals (or those who would like to be), our communications should be professional.
I see from your latest post, Gaurish, that you did not incorporate the tips that I gave you regarding punctuation, spacing and capitalization. That tells me something about you. What it tells me might be thoroughly wrong, but all I have to go by is the public face you present. If you present a face that shows no concern for accuracy, then the only information I have about you conveys that you donât care about accuracy. (As I said, that might be a mistaken impression, but I have no evidence to go by to assess that as inaccurate. What else can I do? What else can anyone do?)
This then carries over into my impression of the code you posted. Without having read it (it is a long post, after all), I expect it to have errors, because your non-code communication has tons of errorsâeven after those classes of erros have been pointed out to you.
Apocolypse2005,
Youâre probably right. But after 3 publications by Gaurish in a row, I was in a mood to say, âOh, for crying out [u]LOUD</u>! Give me a break!â even the more so for having to try to interpret such sloppy writing.
Iâm not actually sure that Gaurish can write correctly. I mean, I only have what he has written to go by.
See, because my writing is largely correct (spelling, punctuation, capitalization, syntax, coherency), you are inclined to be sure that when I fumble-fingers a word (as you accurately point out) it is beyond doubt an accident, not a habit or lack of knowledge.
I find that the vast majority of posts from India have this oddity of âxxx ,xxxâ instead of âxxx, xxxâ and âend of sentence.next sentenceâ instead of âend of sentence. Next sentence,â so I presume it is a syntax mixup between the writing native to that nation as over agains English. If I were trying to write in the writing that is native to India, and made a similar class of error, I would be grateful to have someone politely point that out to me.
I did not say anything like âWhat? Are you stupid?â because I donât have any such feeling. I just presume it has to do with converting Indian thought patterns into English syntactical patterns. So I give some âtipsâ when I see that...
|
|

April 8th, 2008, 07:46 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
gaurisharya, you asked "Please reply if this code was helpful to you."
Brian Wren replied with HIS suggestions on how to write in a more proper English. English is not my first language, and I never complain when someone corrects my English, om the contrary I am happy and grateful for it. Personally, I agree with Brian. As a professional, I prefer to read in proper English.
Regarding your code: it is not original, code that adds a TextBox to allow editing in a grid is very common, it can be found in the very first books of Visual Basic, in versions prior of VB6. It is of course also explained in the MSDN documentation:
http://msdn.microsoft.com/library/de...lexSprdsht.asp
Secondly, there is not even a line of comment in your code, you do not even say that to start edit you have to double click in a cell of the grid
Thirdly, in the Click event you reference a component (chkSelect) that you don't mention anywhere, and it works only if the grid has more than 6 columns. In the same event, you set two variables (lrow and lcol) that are not declared. And it is not clea when you stop editing.
And more, you are using the arrows key in the TextBox event to shift to a different cell of the grid, and that makes a little hard to move the cursor inside the TextBox itself, making impossible to edit what we are writing. And when editing, if you scroll the grid using the scrollbar the textBox remains Visible and does not change position, so it seems that you are editing another Cell. The Scroll event (as well as the LostFocus) should terminate the editing.
I appreciated your effort, but code written in that way IMHO is useless. Snippet of code must be complete, easy to understand, a lot of comments, and of course, with no bugs. Last but not least, it must be explained how it works.
Sorry for this negative comment.
and BTW, sorry for my English
BTW2: it is also possible to edit a grid without using a TextBox:
http://www.freevbcode.com/ShowCode.asp?ID=3034
"There are two ways to write error-free programs. Only the third one works."
Unknown
|
|

April 9th, 2008, 12:00 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
|
|
Hi Brian, Gauri and all
There seems to be too much discussion on this topic.
Gauri, as Brian said this forum is mainly for answers for queries. Most often programmers search this forum for a query and will look into the topic if they find any replies (i.e., answers). Since your posts are general and will not require any answer, I am afraid that it would not be read.
Though english here need not be highly grammatical, It would be better to keep it short and simple.
I would suggest you to take Brian's advice in postive way and contribute a lot to the forum
Thanks
Shasur
http://www.dotnetdud.blogspot.com
VBA Tips & Tricks ( http://www.vbadud.blogspot.com)
|
|
 |