Personal Schedule

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 5267 Views - Last Post: 20 January 2012 - 02:47 PM Rate Topic: -----

#1 Keylogger  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 348
  • Joined: 14-February 11

Personal Schedule

Posted 18 January 2012 - 09:38 AM

Hi people.
I would like to know if it's possible to do something like this:
Posted Image
in VB.NET?

If yes, it needs an external toolkit or not? Thanks.
Is This A Good Question/Topic? 0
  • +

Replies To: Personal Schedule

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13947
  • View blog
  • Posts: 55,683
  • Joined: 12-June 08

Re: Personal Schedule

Posted 18 January 2012 - 09:43 AM

Sure that's possible to do with VB.NET. Clearly you could shave some time and headache off by using third party controls - but those could be created with some heavily modified user controls.
Was This Post Helpful? 0
  • +
  • -

#3 Keylogger  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 348
  • Joined: 14-February 11

Re: Personal Schedule

Posted 18 January 2012 - 09:56 AM

How is that? Re-editing controls I never did.
For example, I thought about a DataGridView (seems the best control for this) do you agree?
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13947
  • View blog
  • Posts: 55,683
  • Joined: 12-June 08

Re: Personal Schedule

Posted 18 January 2012 - 10:13 AM

Quote

How is that? Re-editing controls I never did.

Sure... add a user control to your project (right click on the project -> add -> user control). You then can make it directly inherit from a specific control (like a textbox, grid, etc), or just combine controls in this and have them act a specific way. Say have a checkbox, combobox, and textbox to make a combobox that allows for selecting from it or creating a user defined entry based on if the checkbox for 'new' was checked. Good times.



Quote

For example, I thought about a DataGridView (seems the best control for this) do you agree?

A grid may do well for part of it yes. Something with a custom column type or a clever arrangement of custom list boxes and fore go the grid all together. So many options... so little time!
Was This Post Helpful? 2
  • +
  • -

#5 Keylogger  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 348
  • Joined: 14-February 11

Re: Personal Schedule

Posted 18 January 2012 - 10:41 AM

I think that could be an option (using Listboxs with DataGrid) because I think that with the actual DataGrid it is not possible to do several things..for example put several things with different colours etc in the same row, some above, others under.

For me that I don't know anything about Custom User Control there's any tutorial you recommend? Or just google?
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13947
  • View blog
  • Posts: 55,683
  • Joined: 12-June 08

Re: Personal Schedule

Posted 18 January 2012 - 10:55 AM

Quote

For me that I don't know anything about Custom User Control there's any tutorial you recommend? Or just google?

Yes.. I would hit up the tutorials here (example of a few below) and then google it. Just think of it like having two discrete lego blocks and combining them together to make a new block with functionality of both!

http://www.dreaminco...controls-knobs/
http://www.dreaminco...ustom-controls/
http://www.dreaminco...a-user-control/
Was This Post Helpful? 0
  • +
  • -

#7 Keylogger  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 348
  • Joined: 14-February 11

Re: Personal Schedule

Posted 18 January 2012 - 07:04 PM

It seems to me the best choice was to develop RichTextbox into DataGridView in order to perfom several changes that Textbox don't let.

So I did it according to this Tutorial for MonthCalendar http://msdn.microsof...y/7tas5c80.aspx
I changed it to RichTextbox and it's working.

However, a little problem appears: How can I make changes in this RichTextbox? I mean, make selected text bolded, etc.

I already detected which one is the RichTextboxCell and its working (it detects):
If Me.DataGridView1.Rows(0).Cells(1).GetType.Name = "RichTextboxCell" Then
            Bold(Me.DataGridView1.Rows(0).Cells(1).Value)
        End If
Private Sub Bold(ByRef RichText As RichTextBox)
        If RichText.SelectionFont IsNot Nothing Then

            Dim currentFont As Font = RichText.SelectionFont
            If RichText.SelectionFont.Bold = True Then
                RichText.SelectionFont = New Font(currentFont, FontStyle.Regular)
            Else
                RichText.SelectionFont = New Font(currentFont, FontStyle.Bold)
            End If

        End If
    End Sub


But then I get this error:

Quote

Unable to cast object of type 'System.String' to type 'System.Windows.Forms.RichTextBox'.


Btw, it's a nice idea implementing this method? RichTextbox can accept several objects, drag n' drop, colours etc.

Edit: And while writing the post I noticed this:
Private Sub Bold(ByRef RichText As RichTextBox)

Of course it won't work because I'm telling this:
Bold(Me.DataGridView1.Rows(0).Cells(1).Value)

I'm not telling which RichTextbox is. Any ideas? Maybe with CType conversion?

This post has been edited by Keylogger: 18 January 2012 - 07:05 PM

Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13947
  • View blog
  • Posts: 55,683
  • Joined: 12-June 08

Re: Personal Schedule

Posted 18 January 2012 - 07:07 PM

Which line is it happening on?
Was This Post Helpful? 0
  • +
  • -

#9 Keylogger  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 348
  • Joined: 14-February 11

Re: Personal Schedule

Posted 18 January 2012 - 07:18 PM

In this line:
Bold(Me.DataGridView1.Rows(0).Cells(1).Value)

But the error is totally correct. I'm telling the value to the Sub and it needs the RichTextbox.

It's like, I should have RichTextCell_1, _2, _3..etc.

This post has been edited by Keylogger: 18 January 2012 - 07:18 PM

Was This Post Helpful? 0
  • +
  • -

#10 Keylogger  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 348
  • Joined: 14-February 11

Re: Personal Schedule

Posted 18 January 2012 - 07:39 PM

Well, I did it in the class file. Here's an example:
Protected Overrides Sub onkeydown(ByVal e As System.Windows.Forms.KeyEventArgs)
        If (e.Control) Then
            Select Case e.KeyCode
                Case Keys.B
                    Me.SelectionFont = New Font(Me.Font.FontFamily, 10, FontStyle.Bold)
            End Select

        End If
        MyBase.onkeydown(e)
    End Sub


But if I want a button outside the DataGridView I still don't know how to do. :(
Was This Post Helpful? 0
  • +
  • -

#11 Keylogger  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 348
  • Joined: 14-February 11

Re: Personal Schedule

Posted 19 January 2012 - 08:46 AM

Well, I've been thinking and the buttons aren't necessary, the keys is enough. I changed my .Class file because the RichTextboxCell was not accepting .RTF values, only Text but now it's working.

According to the image I put in the first post, I'm thinking about the possibility of put inside all RichTextboxCells the number of day (1, 5, 12) according to that month and according to the week days (Sunday, etc) like in the image.

Any ideas of how to do this? Because then people could change Months and must appear everything on the correctly on the RichTextboxCells.
Was This Post Helpful? 0
  • +
  • -

#12 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13947
  • View blog
  • Posts: 55,683
  • Joined: 12-June 08

Re: Personal Schedule

Posted 19 January 2012 - 09:01 AM

Quote

According to the image I put in the first post, I'm thinking about the possibility of put inside all RichTextboxCells the number of day (1, 5, 12) according to that month and according to the week days (Sunday, etc) like in the image.

Any ideas of how to do this?

Labels docked to the top of each cell would seem sufficient.
Was This Post Helpful? 0
  • +
  • -

#13 Keylogger  Icon User is offline

  • D.I.C Regular

Reputation: 7
  • View blog
  • Posts: 348
  • Joined: 14-February 11

Re: Personal Schedule

Posted 19 January 2012 - 10:11 AM

I'll give a try.
What about putting labels/buttons inside the cell? I can get the text normally, but if I format Text Label to Bold, Italian and 15px, if I drag n' drop it to the cell it will appear the label without format.
Was This Post Helpful? 0
  • +
  • -

#14 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13947
  • View blog
  • Posts: 55,683
  • Joined: 12-June 08

Re: Personal Schedule

Posted 19 January 2012 - 10:19 AM

I am not sure what you mean.
Was This Post Helpful? 0
  • +
  • -

#15 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 206
  • View blog
  • Posts: 823
  • Joined: 21-December 11

Re: Personal Schedule

Posted 19 January 2012 - 10:28 AM

View Postmodi123_1, on 18 January 2012 - 10:13 AM, said:

Sure... add a user control to your project (right click on the project -> add -> user control). You then can make it directly inherit from a specific control (like a textbox, grid, etc), or just combine controls in this and have them act a specific way. Say have a checkbox, combobox, and textbox to make a combobox that allows for selecting from it or creating a user defined entry based on if the checkbox for 'new' was checked. Good times.


Never knew that! sounds pretty cool! Imma try it out right now :D thanks modi :)
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2