Results 1 to 17 of 17

Thread: Mythical Control? or Technique?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    8

    Mythical Control? or Technique?

    I've been programming with VB for a while, but I'm having a problem find the answer to the following control question...

    I need to output text, but with the following conditions (I will have my original choices for these in parentheses, and the reason why I have discounted them):

    1 - I need to have some of the text print in columns. HOWEVER, these columns (or tabs) can change as I print my text. For instance, The first line will have 4 columns, and so on through line 10. Line 11 will have 6 columns of numbers. So, the columns need to be flexible. (hence, no MsFlexGrid)

    2- I need to be able to scroll. I have a lot of data to show, so it needs to be scrollable, it probably will not fit on one window (hence, no printing directly to the form).

    3- I need to be able to click on a name in the text and have the program react, just like I was clicking on a label or something. (hence, no printing to a PICTURE control OR printing directly to a window. PICTURE would give me scrolling, but no ability to click on text in the window.

    4- There is NO EDITING of the data...it's basically a printout.

    That's basically it...I have no idea how to combine scrolling, changing columns (formats) and click-ability. I've seen the IE Explorer control, and know with hypertext it would give me the clickability and the scrolling (and possibly the columns) - but I haven;t seen anywhere in the documentation or on the web how to use it in that vein (besides the typical - "here's how to make a web browser"). Is this control the only option? Will I now have to learn HTML?! I don't know it already, and would have no idea how to change my original text into HTML for formatting in this control...

    Anyone have any ideas? Am I missing something? Another control? Or, can I do all this with one of the controls I mentioned?

    Thanks much,

    Craig

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    1) You can use a PictureBox and you can print to it just like the printer.

    2) You can put one picturebox within another and add a scrollbar or scrollbars and with some fairly simple code you can scroll.

    3) Don't know how. MouseOver? API?

    4) You don't have to worry about for a picturebox.

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    8
    Thanks Marty, yes, I know there is a technique to scroll using a picture box. The big problem with using a picture box is requirement #3, how do I make some words clickable (and preferably look like html hypertext i.e. blue and underlined). I can see trying to perhaps "fake it", but I'd prefer to have it control-like. You know, when you click on label, it triggers the label.click event...something like that. I know there has to be answer out there somewhere, I'm just not sure where.

    -Craigsca

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    I don't understand why you discounted the flexgrid? Can you explain further.

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    8
    EDIT: well...surprise, surprise! My columns didn';t come out right on the post below...Hopefully, there's a link at the bottom which shows what I'm driving at, including the hypertext links to individual players.

    EDIT 2: Actually, click on the link at the bottom, and then click on "Box Score >>". Thanks!


    Sure, Bruce...

    Basically, if you're familiar with baseball, I want the ability to print out a boxscore. Boxscores usually look something like this:


    We start with batter information...visiting team on the left side, home team on the right...

    AB R H RBI AB R H RBI
    Jones 5 0 1 1 Jackson 4 0 0 0
    Smith 4 1 2 0 Thompson 3 1 0 0
    Dempsey 4 0 1 0 Horace 4 0 1 0

    etc.....etc.... until...the middle piece, which shows info like double, triples, homeruns, double plays, etc...

    2B- Johnson 2, Smith
    HR - Clark (22), Haney 2 (17)
    etc....etc...


    finally, we show columns again, showing the pitching statistics for the game...

    IP H R ER W K
    Simon 4.2 5 3 3 1 0
    Babson 1 0 0 0 0 0

    etc....etc....


    So...the top piece (with batter information) needs to have it's own columnar format. The second piece has NO columns at all...and the 3rd piece has columns again, but more of them, and a different width than the batter information.

    BTW - I want to be able to click on any name, to call up their "card". I can do the card part, I just need the program to recognize the click and who it's being clicked on.

    I hope this shows up on the post...I have a fear of proportional fonts and the space bar in the forums

    -Craigsca
    Sample Boxscore
    Last edited by CraigSca; Dec 30th, 2002 at 10:02 PM.

  6. #6

  7. #7

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    8
    It doesn't HAVE to be one control, but if I use 3 flexgrids, I'll have 3 different scroll bars to contend with. I want it to be one continuous scroll and look seamless. I've seen it done before, I'm just not sure how people have done it...

  8. #8
    Frenzied Member John McKernan's Avatar
    Join Date
    Jan 2002
    Location
    SE PA
    Posts
    1,295
    I'm not entirely sure I'm following the problem (if not ignore me) but the MSHFlexGrid will allow you to merge cells. Would this be of use to you?

  9. #9

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    8
    I think that MAY work - I'll have to look into how to use it (and merge cells). I suppose i could make a HUGE grid with...say...50 columns and then merge and unmerge as I need them. With the Hierarchical grid - can I merge on one line, and then unmerge the next?

    It'll be a lot of work...but if I map it out correctly, I suppose this is do-able. Let me check it out - thanks for your input .

    -Craigsca

  10. #10

  11. #11
    Frenzied Member John McKernan's Avatar
    Join Date
    Jan 2002
    Location
    SE PA
    Posts
    1,295
    OK, here's a quick example. I didn't bother to format or size the cells so it doesn't look as good as it could, but it's the idea.
    Attached Files Attached Files

  12. #12

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    8
    Oh man, thanks much! Was just looking through the Controls Reference Guide and saw it to be a rather daunting task. From the guide, I see you can only merge cells that have the same data...eek!

    Can;t wait to see the snippet - perhaps it'll show me that this is kinda easy after all

    -Craigsca

  13. #13
    Frenzied Member John McKernan's Avatar
    Join Date
    Jan 2002
    Location
    SE PA
    Posts
    1,295
    Yeah, the catch is the cells to be merged must contain the same data, but if you can take care of that when you are populating the cells, it works nicely. It takes a bit of planning, of course.

    If you can't do this when populating the data, the merge cells probably isn't going to work out too well.

  14. #14

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    8
    Ok...got the code - thanks much!

    Yes, it's just like I thought - not TOO difficult, but will take me some time mapping out a grid to come up with a format that looks right. Also...do you think MergeCells will merge cells with " " (no data) in them and merge them, or do you think it only merges cells with real data? Will have to figure that out.

    Thanks for tackling this one, appreciate it.

    -Craigsca

  15. #15

  16. #16

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    8
    Excellent! Was just going to try it now . Again, thanks - was fun getting my questions answered before I even finished my "question" post. Was like a pseudo-Instant Message session for a minute there!

    -Craigsca

  17. #17
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Originally posted by CraigSca
    It doesn't HAVE to be one control, but if I use 3 flexgrids, I'll have 3 different scroll bars to contend with. I want it to be one continuous scroll and look seamless. I've seen it done before, I'm just not sure how people have done it...
    If you can make the one-grid-merge-cells work for you great, but if not here is a very crude example of two flexgrids and there is only one scrollbar.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width