VB6 Question

Joe Mamma said:
How in the hell do you emulate clicking on a control in VB6.

In Delphi it is just

MyControl.Click;

haha :)

Joe in VB6... Im sure it must be pure unadultrated hell for you :D
 
Shazbots said:
controlname_Click
actually I wanted to send a message to a piece of crap flexgrid because setting the row value selected a cell even though I have row select only set. If I clcik on the row the entire row is selected, so I was trying to fool it.

what the sam hell is a twip???

god vb6 is a piece of crap.

[edit]Poor choice of language Joe.[/edit]
 
Last edited by a moderator:
For someone that hates Visual Basic 6 so vehemently, because its "counterintuitive" (your words), its ironic that invoking a function seems to be foreign to you. ;)
 
command_click is an event handler,
It is a method of the form, not a method of the control.
I have no defined handler for the control
I dont even want to define an event handler.

what I wanted to do was send a message to the control. I had to declare a call to SendMessage in the API.

You see, the problem I have is that setting MSFlexGrid.Row = 4, selected Cell(1,4), and not entire row 4, despite having set RowSelectOnly.

If I click on row 4, the entire row selected as I had designed.
So I had to declare a call to the API.
But then I had to translate RowPos twips to pixels.

Again, what the hell is a twip???
Does anyone actually do anyting with twips???

Btw way, why is the Flexgrid designed so that to change a cell you have to do:

Grid.Col = 1
Grid.Row = 1
Grid.Text = "aValue"

where in every other language it is simply
Grid.Cell(1.1) = "aValue"

The VB approach triggers RowColChanged events. Which means I had to declare a boolean variable and set that before I programattically changed the row or column in order to prevent the code in the handler from firing.

why cant you programmatically attach and detach handlers in VB6?

And where is the client rectangle in VB controls????
Where is the anchor property?
Is there a splitter in VB6?
How do I make BOLD the fonts in the fixed rows of a flexgrid?
Where are the paint events????

So you know what I have been doing? exporting all the delphi controls as ActiveX controls and using them.

And the VB developer I am working with keeps saying wow! how did you do that???

Oh yeah! I cant attach to form events without wrapping the form in a class!And then, (GET THIS!!!) I have to redeclare the events in the wrapper so other classes can attach to them!

Huh????

I was reading a SAMS book that referred to programming in VB as a groundbreaking RAD environment.

This is not RAD, its BAD!!!!
 
Joe Mamma said:
what the sam hell is a twip???

god vb6 is a piece of crap.

[edit]Poor choice of language Joe.[/edit]
what you didnt like the joke????

Ok, I will rephrase -

what the sam hell is a twip???
I will KISS the next person who says something you take on a twain

peace
 
For someone who hates VB so much, you sure do a LOT of work in the language. I know, I know - not your choice. Funny how there isnt much work in Delphi these days :)

A twip, as Im sure you know, is a type of coordinate meant to make screen coordinates easier. It assumed a 15 inch monitor, I believe. There are conversion functions if inches, pixels, or something else suits you.

As already mentioned, an event handler is always, always, always just a function. It becomes an event handler not because of the function, but because of the code that calls the function at the right time.

As for the flexgrid - its very, very popular. If you really wanted help, maybe post something like "trying to get flexgrid to programmatically highlight whole row". Im sure someone has done what you want - if youre nice, maybe theyll share.

-ner
 
I recall doing work with Flexgrids (the one built into VB6, not a 3rd party) with a bit of a learning curve.

Even the .NET one Im working with (component one) seems less than intuitive. Id think you could just select a cell like FlexgridName.Cell(3,8).select (or whatever).

I recall the VB6 version wasnt so straight forward - or intuitive.

The Component One pack I got for free has two flexgrids - one like the VB6 version and one that has a LOT more options.

After working with it so much I just sort of fell into how they were doing things. Still not very intuitive, but its well documented to say the least.

One word of advice, if you havnt done so already, you might want to try to get help over on our sister forums ExtremeVBTalk (link is at the bottom of these forums).

Now, be warned, dont go crap talking vb6 there as you ask for advice/help, be polite. Over there its still primarily VB6 and these are guys who use it to do virtually anything.
 
Back
Top