Lotusscript: Change width of Messagebox - formatting

Short and easy:
Is there a possibility to adjust the width of a Messagebox? I couldn't find any info about that in the documentation.
My Messagebox uses only about 50% of the available screen width. But I would need this space in order to have a proper formatting.
Furthermore is there a possibility to display some of the worlds in bold text?
Thank you for your help!

You have no real control over messageBox except that you can add lines to your message forcing the dialog to be higher, even that and the width can be overridden by the operating system, leading to truncation, although I don't think it does that anymore.
If you want to display a form based dialog box I recommend looking into #DialogBox, or DialogBox method in the NotesUIWorkspace class.
Here are more details on creating these properly.

Thanks to Simon O'Doherty here's the code, that worked for me:
First of all I creaded a Form (DialogBox) containing a single text field named DIALOG_BOX_MESSAGE
Set doc=db.CreateDocument
doc.Form="(DialogBox)"
Call doc.ReplaceItemValue("DIALOG_BOX_MESSAGE", "My fancy message, to be displayed")
Call ws.DialogBox("(DialogBox)", True, True, True, False, False, True, "Got a fancy title", doc)

Related

(VB 2010) Label's Text extends from it's locked size. How do I scroll to last line?

I've been writing a program that calls batch files (which download some stuff). I've added a label that reports the download progress to the user. The program is going to allow for multiple downloads so at some point the Label will be full of text. When that happens, the text extends from the label and I can't see any of it. What I want is to have the label scroll to the newer line of text added in the label. In other words I want to always have the focus of the label text to be on the last written line. Can some1 post an example that can do this on a label ?
Similar to Steve's comment I would recommend using a multiline text box or RichText control for this purpose. You can set the control's ReadOnly property to True, and the ScrollBars property to Both.
When adding new text to this control, you can use the following code to ensure that it is visible to the user:
TextBox2.AppendText('New text')
TextBox2.SelectionStart = TextBox2.Text.Length
TextBox2.ScrollToCaret()

Is it possible to have an extension library dialog box within a repeat control?

I'm running with an 8.5.3 UP1 server and I have a need to have many dialog boxes (for confirmation purposes) for a whole bunch of "action buttons" on an xpage. The code for these dialog boxes is almost exactly the same with the exception of the confirmation message being different and the client-side JS function they are calling if the Yes button is selected.
Since I really hate repeating code over and over, I was wondering if it is at all possible to put a xe:dialog control within a repeat control and specify the message and function call from an array of values? I know I can't compute the ID of the dialog control and without that I'm not sure how I would reference the dialog to open and close it.
Any ideas? Thanks
Yes, this is possible.
Make sure that you specify that the dialog box's property for keepComponents is set to False. You don;t have to do anything special for opening or closing the dialog box, just use whatever ID you give the dialog box in you client-side action to open the dialog box in the repeat such as XSP.openDialog('#{id:myDialog}')
The XPages renderer will automatically calculate the correct ID names for you.

ReportViewer: two text colors, one cell

Is it possible to have 2 areas of text in one cell such that each can have a different color? You can do this in crystal reports but I cannot see a way to do this in ReportViewer. What it is doing is essentially highlighting an important text fragment if it appears in a cell description to draw the users attention. I am fairly new to reportviewer so it for now I am assuming it's my lack of knowledge that is making this difficult. I am using VS2010.
Thanks.
Turns out VicarlnATutu wasn't quite right.
You can do this, but only if you are using VS2010 (which I am) because it includes the new SSRS rendering engine for SQL-Server 2008. This allows you to put some basic HTML into a field and have multiple formats in one cell. For more info see below:
http://msdn.microsoft.com/en-us/library/cc645967.aspx
http://msdn.microsoft.com/en-us/library/cc627491.aspx
One thing that tripped me up is what they call a 'placeholder' in the MS documentation is the little bit of text inside the textbox control that shows up by default. You can select two different things on the control in VS2010. One is the textbox itself. Right clicking on the textbox gives you 'text box properties'. The other thing you can select is the default text INSIDE the textbox. Right clicking on this 'placeholder' text gives you a different context menu where you can select 'placeholder properties'. This is where you can change the cell to accept HTML.
No, unfortunately not. I don't know if there are custom controls out there for ReportViewer, but the built-in TextBox only supports setting color (be it Foreground or Background) for the entire thing.
ah, good to know. kind of a unintuitive way to tell a TextBox to display HTML, but nice to know that you can!

Textbox in Visual Basic

Lately I have been programming an application in Visual Basic 2008, and on one of my Windows Application forms I have several text box forms, and with my code the way it is, none of them can be enabled, and they must all be set to Read Only.
Now if I put a big block of text in one of the Text Box's that extends past the parameters of the box, the scroll bar appears but doesn't scroll because of making it's enabled false. So here's my question, is there any way I can make the Text Box's scroll bar functional but still leaving the enabled set to false?
You should be able to use textbox1.Readonly = true instead of textbox1.enabled = false. Then you can use the scrollbars.

VB.Net MessageBox.Show() moves my form to the back

I have an MDI application. When I show a message box using MessageBox.Show(), the entire application disappears behind all of my open windows when I dismiss the message box.
The code is not doing anything special. In fact, here is the line that invokes the message box from within an MDI Child form:
MessageBox.Show(String.Format("{0} saved successfully.", Me.BusinessUnitTypeName), "Save Successful", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
Me.BusinessUnitTypeName() is a read only property getter that returns a string, depending upon the value of a member variable. There are no side effects in this property.
Any ideas?
Remove the last parameter, MessageBoxOptions.DefaultDesktopOnly.
From MSDN:
DefaultDesktopOnly will cause the
application that raised the MessageBox
to lose focus. The MessageBox that is
displayed will not use visual styles.
For more information, see Rendering
Controls with Visual Styles.
The last parameter allows communication of a background Windows Service with the active desktop through means of csrss.exe! See Bart de Smet's blog post for details.
Remove the MessageBoxOptions.DefaultDesktopOnly parameter and it will work correctly.
DefaultDesktopOnly specifies that "The message box is displayed on the active desktop" which causes the focus loss.
These answers are correct, but I wanted to add another point. I came across this question while working with someone else's code. A simple message box was causing the front most window to move to the back:
MessageBox.Show("Hello").
Turns out, there was a BindingSource.Endedit command before the MessageBox. The BindingSource wasn't connected to any controls yet, but it caused the window to change z-positions.
I am only including this note since my search brought me to this question and I thought it might be helpful to someone else.