Wrox Programmer Forums
|
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
 
Old April 5th, 2008, 01:35 AM
Registered User
 
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Editing MSFlexGrid in VB6

hi
 
Old April 7th, 2008, 03:22 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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
 
Old April 7th, 2008, 03:58 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

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.
 
Old April 7th, 2008, 11:13 PM
Registered User
 
Join Date: Mar 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old April 8th, 2008, 11:22 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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...
 
Old April 8th, 2008, 07:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old April 9th, 2008, 12:00 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

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)





Similar Threads
Thread Thread Starter Forum Replies Last Post
MSFlexGrid in VC++ arun.sharma.kumar Visual C++ 0 March 24th, 2007 02:27 AM
MSFlexGrid loveperson Beginning VB 6 1 January 18th, 2005 11:45 AM
Msflexgrid with Textbox Rudner Pro VB 6 2 November 26th, 2004 05:57 AM
MsFlexGrid vs. DataGrid - which ? mike123abc SQL Server 2000 3 November 19th, 2003 11:19 PM
MSFlexGrid meireliezer Visual C++ 0 November 19th, 2003 07:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.