Print Page | Close Window

Cant enter multiple lines Multiline control???????

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=11022
Printed Date: 31 May 2024 at 4:41am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Cant enter multiple lines Multiline control???????
Posted By: BoboP
Subject: Cant enter multiple lines Multiline control???????
Date Posted: 13 June 2008 at 7:00am
Hi !

I have used property grid in my application , where I needed multi-line
text box for value part.

I have it , but then i cant enter multiple lines into it.
it just lets enter only one line.

PropertyGridItem itemP;
                       
itemP = materialDetailItem.AddChildItem(PropertyItemType.PropertyItemMultilineString,"hi","")

itemP.EditStyle = PropertyItemEditStyle.EditStyleMultiLine;

                        itemP.MultiLinesCount = 3;
                        itemP.Height = 100;
                      

whats wrong here ?

Thanks





Replies:
Posted By: Oleg
Date Posted: 13 June 2008 at 12:06pm
Hi,
 
By default user have to press Ctrl+Enter for new line.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: BoboP
Date Posted: 14 June 2008 at 12:49am
Hi ! Oleg !

Thanks for replying . I tried pressing Ctrl + Enter . But No use ,

What else can be the reason ? , I have ok button on the same form set as Accept button . So whenever I press enter ok button is pressed , Can this interfere in property grid Ctrl+Enter.

I have been trying this . I read earlier post regarding multi line control . But I can only enter only one value.






Posted By: Oleg
Date Posted: 14 June 2008 at 5:22am
Hi,
 
Do you have VariableItemsHeight  = True ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jpbro
Date Posted: 14 June 2008 at 9:38am
Hi BoboP,

The PropertyItemMultilineString type seems to be for creating a drop-down multiline edit window that accepts an unlimited amount of text...The PropertyGrid cell portion will only accept a single line. if you want to limit the lines and accept Enter in the PG cell portion, try the following code:

(NOTE: You will have to adapt this slightly for the language you are using, I just realized you aren't using VB6...It should be fairly straight forward.)


Private Sub Form_Load()
   Dim itemP As PropertyGridItem
   Dim objCat As PropertyGridItem
                      
   With Me.PropertyGrid1
      .VariableItemsHeight = True
      Set objCat = .AddCategory("Test")
   End With
  
   Set itemP = objCat.AddChildItem(PropertyItemString, "hi", "")  ' Don't use PropertyItemMultilineString
                                                                  ' it seems to just give you a multiline dropdown
                                                                  ' The dropdown allows for unlimited lines no matter what
                                                                  ' and the grid cell seems to only allow for a single line
   With itemP
      .EditStyle = &H1000  ' &H1000 = Want return style (so user doesn't have to pres Ctrl+Enter)
                           ' Don't use EditStyleVScroll unless you want the user
                           ' to be able to enter unlimited lines of text
      .MultiLinesCount = 3 ' Allow the regular string cell to be three lines high.
   End With
End Sub





-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net