Joe Mamma Posted November 11, 2004 Posted November 11, 2004 How in the hell do you emulate clicking on a control in VB6. In Delphi it is just MyControl.Click; Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Denaes Posted November 12, 2004 Posted November 12, 2004 How in the hell do you emulate clicking on a control in VB6. In Delphi it is just MyControl.Click; haha :) Joe in VB6... I'm sure it must be pure unadultrated hell for you :D Quote
Joe Mamma Posted November 12, 2004 Author Posted November 12, 2004 (edited) 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] Edited November 12, 2004 by Derek Stone Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
*Gurus* Derek Stone Posted November 12, 2004 *Gurus* Posted November 12, 2004 For someone that hates Visual Basic 6 so vehemently, because it's "counterintuitive" (your words), it's ironic that invoking a function seems to be foreign to you. ;) Quote Posting Guidelines
Joe Mamma Posted November 12, 2004 Author Posted November 12, 2004 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!!!! Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Joe Mamma Posted November 12, 2004 Author Posted November 12, 2004 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 Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
*Experts* Nerseus Posted November 12, 2004 *Experts* Posted November 12, 2004 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 isn't much work in Delphi these days :) A twip, as I'm 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 - it's very, very popular. If you really wanted help, maybe post something like "trying to get flexgrid to programmatically highlight whole row". I'm sure someone has done what you want - if you're nice, maybe they'll share. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Denaes Posted November 12, 2004 Posted November 12, 2004 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 I'm working with (component one) seems less than intuitive. I'd think you could just select a cell like FlexgridName.Cell(3,8).select (or whatever). I recall the VB6 version wasn't 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 it's well documented to say the least. One word of advice, if you havn't 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, don't go crap talking vb6 there as you ask for advice/help, be polite. Over there it's still primarily VB6 and these are guys who use it to do virtually anything. Quote
Moderators Robby Posted November 13, 2004 Moderators Posted November 13, 2004 A TWIP is 1440th of an inch (approx) irrelevant of the screen resolution. Quote Visit...Bassic Software
ThePentiumGuy Posted November 15, 2004 Posted November 15, 2004 I'm sure there's a gridsetting to set it to Pixels instead of Twips. I remember doin somethin like this a while ago Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.