Results 1 to 17 of 17

Thread: [RESOLVED] [2005] Is this possible

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2007
    Posts
    520

    Resolved [RESOLVED] [2005] Is this possible

    Heya guys

    I have a BIG question for you all. i know that if its possible to do there will be someone in here that will know how to do it.

    Basically there are two things which i am tryin to do.

    1. When a button is clicked i want a datagridview to reduce in height and stuff displayed. i realise that this can be done by just changing the height however i would quite like it to visably scroll up.

    2. I would like something (a calander) to appear when you click a button but have it infront of other things almost hovers and then when a date is double clicked the calander closes.

    Is any of this possible

    I look forward to you replys

    Frosty
    Last edited by frosty16; May 1st, 2007 at 04:58 PM.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [2005] Is this possible

    1) Change the height inside of a loop, decrementing it by a set value on each iteration.

    2) You mean like the Date Time Picker? Or the Calendar control?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2007
    Posts
    520

    Re: [2005] Is this possible

    i mean the calendar control.
    basically i want a calendar like that in the calendar control

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2007
    Posts
    520

    Re: [2005] Is this possible

    for the loop i hav used the following code:

    Code:
    Dim intHeight As Integer
            Dim intEndHeight As Integer
            intHeight = DataGridView1.Height
            Do Until intEndHeight = 220
                intHeight = intHeight - 5
                DataGridView1.Height = intHeight
                intEndHeight = intHeight
            Loop
    however it doesnt seem to stop at 220 it just keep going
    what have i done wrong?

  5. #5
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2005] Is this possible

    Your intEndHeight will never equals 220, because with each iteration, you decrease the intHeight and set intEndHeight = intHeight...
    Actually, you don't need intEndHeight at all. Just do it like this
    Code:
    Dim intHeight As Integer = DataGridView1.Height
            Do Until intHeight >= 220
                intHeight = intHeight - 5
                DataGridView1.Height = intHeight
            Loop

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2007
    Posts
    520

    Re: [2005] Is this possible

    brilliant that works, well it does if you change the '>' to a '<'.
    so can anyone help me with the second problem?

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [2005] Is this possible

    If you want the calendar control, why not just use it? Make a form that has nothing else on it, and show that as needed.
    My usual boring signature: Nothing

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2007
    Posts
    520

    Re: [2005] Is this possible

    i thought about that however i thought that someone might know how to do it.
    if knowone does then i will do it that way

  9. #9
    Addicted Member
    Join Date
    Jan 2007
    Posts
    143

    Re: [2005] Is this possible

    Quote Originally Posted by frosty16
    i thought about that however i thought that someone might know how to do it.
    if knowone does then i will do it that way
    wouldn't the "Month Calender" control work just fine... use the button to "Show" and "Hide" it?

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2007
    Posts
    520

    Re: [2005] Is this possible

    the show hide feature on the calander would work however i need it to be on top ov everything is that is the case i am having troubles with

  11. #11
    Addicted Member
    Join Date
    Jan 2007
    Posts
    143

    Re: [2005] Is this possible

    Quote Originally Posted by frosty16
    the show hide feature on the calander would work however i need it to be on top ov everything is that is the case i am having troubles with
    On top... hmm... too bad there isn't a "topmost" property for the calanders... (not sarcasm...).

    I don't see why you would have troubles keeping it on top... maybe you could post your what you have so far on here?

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2007
    Posts
    520

    Re: [2005] Is this possible

    so far what i have is:

    Code:
        Private Sub cmdCalendar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdContactSave.Click
    Calendar.visable= true
    End Class
    that displayes the calendar however is it no on top of everything else
    also is the a double click event for a calendar i.e double clicking the date

  13. #13
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [2005] Is this possible

    Put the calendar in its own form. Then do a showdialog of that form. That way they cannot go back to the other form until they are done on the calendar form.

  14. #14
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [2005] Is this possible

    Quote Originally Posted by Negative0
    Put the calendar in its own form. Then do a showdialog of that form. That way they cannot go back to the other form until they are done on the calendar form.
    That's what I was saying. Why try to reinvent the wheel? You can make a form behave the way you want it to, and the control can fill the form. The only thing that matters is what the user thinks is going on, not what is really happening, so this workaround should be manageable.
    My usual boring signature: Nothing

  15. #15
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [2005] Is this possible

    Quote Originally Posted by Shaggy Hiker
    That's what I was saying. Why try to reinvent the wheel? You can make a form behave the way you want it to, and the control can fill the form. The only thing that matters is what the user thinks is going on, not what is really happening, so this workaround should be manageable.
    I was agreeing with you Shaggy, I probably should have stated that.

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2007
    Posts
    520

    Re: [2005] Is this possible

    what i didnt realise uptill today was that you could remove the frame from the form which is what i was hoping you could do however i didnt realise that it was possible to do
    thank you all and sorry for being a pain

  17. #17
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [RESOLVED] [2005] Is this possible

    Don't worry about that. It was actually an interesting discussion about means of accomplishing a design task. You can get where you want to go, but sometimes it takes some odd thinking to get there.
    My usual boring signature: Nothing

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