|
You will have to iterate through all of the form objects and if they are open, add them into the listbox.
Something like this:
foreach(Form childForm in MdiChildren) listBox1.Items.Add(childForm.Text);
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
It didn't work, but i think it would be something like that.
I'm gonna try more ways.
Thanks.
|
|
|
|
|
It should be something in that nature...My code was just a rough one, and it worked for me.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi,
I have a Datagrid with Product details (productcode, ProductName, and Color). I have to make the color column as a combobox, that the user can select the color from the list. The problem I am facing is, I don't need all colors to the combobox, I need colors available for that particular product only. (ie combobox list should be dynamic as per the indivitual Item or individual row). Please Help mE, its Urgent.....
with regard s
Binu Varghese
Thanks in Advance..........
|
|
|
|
|
I have a button that launches a URL based on a text string provided to it.
I want that text to be linked to the column 6 of the row selected in my DataGridView. Basically, i want to know how can i use the current index of row and column.
Historically i have been using the text in a text box using the following syntax
private void toolStripLabelbutton1_Click(object sender, EventArgs e)<br />
{<br />
CommonFuncs.OpenURLSource(<br />
LinkGenerator.button1Source(this.textBox.Text));<br />
}
Any help is appreciated.
|
|
|
|
|
If you want to retrieve text of the cell at row i and at column j then you can use this:
datagridview1[j,i].Value where datagridview1 is the name of the datagridview. Note that the returned Value property returns object so you will need to convert it to string
|
|
|
|
|
What if, for row i in the datagridview1[j,i], I want row to be the row row selected or clicked?
|
|
|
|
|
I may be asking prematurely, without first doing the necessary homework, but I need to ask before I leave work, so I can really get stuck into the homework. I would like to present the same arrangement for colour options that Visual Studio uses in its Fonts and Colors options dialogue. I have some good resources on how to use ColorEditor, in a PropertyGrid and even externally, on its on a form. I'm just not sure if the material covers the actual color display used in the dropdowns.
I gather ColorEditor overrides a DropDown event, displaying the ColorEditor panel when the user clicks a drop down, but in PropertyGrid when not dropped down, only the colour name is displayed. I want one of those fancy dropdowns that shows the selected colour in the texbox area of the dropdown.
|
|
|
|
|
There's a custom pickers article somewhere on CP that illustrates this, but basically what you're saying is right, if you owner draw it you can fill it with a color.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I was actually looking for something to rip a control out of, but I suppose owner drawing a rectangle isn't that hard. It's not just filled with colour, it has a smaller rectangle filled with colour to the left of the actual colour name.
|
|
|
|
|
I posted this in the wrong forum, so here is a link to it:
http://www.codeproject.com/script/comments/forums.asp?forumid=1642&select=2300199&msg=2300199
|
|
|
|
|
I'm busy designing a custom grid that should be able to accommodate interleaved rows with varying column structures. I only need very lightweight functionality, so instead of extending a DataGridView, I'm creating my grid from scratch using a DataRowControl, which is a Panel with one Textbox for each column in the definition for a row. Then I arrange a collection of these DataRowControls vertically, one for each row in my data source, on another panel. Is there a better way to do this?
Now, when I do what I describe above, the first problem I find, and I'm sure you'll see many more posts on this here by me, is sizing. I don't want a scrollbar on each row, so my row Panel has AutoScroll set to false, but the Panel holding all the rows has AutoScroll = true. However, in this arrangement, I still only get vertical scrolling. Am I doing something wrong?
In summary, is my whole approach to this problem on the right track?
|
|
|
|
|
I am currently working on a project that involves previewing large amount of photoes at the same time, my program will have a view at which it will show the preview of all the image files in a particular directory. As of this moment, all the pictures are shown by using creating a PictureBox control for each picture and then shoving them into a panel.
I realize that the mem usage is huge after loading about 120 pictures of ~900kb in size. I am suspecting it is because each PictureBox has loaded the FULL image into the memory, but not the thumbnail.
I do realize that in the Image class, there is something called the getthumbnail() mehtod, how do i make use of this? Image is an abstract class, i cant use it directly, do i use some kind of file reader to open a stream and read it as an Image and then use the getthumbnail() method to get a thumbnail and then use it as the image for the pictureBoxes?
thank you for your help
|
|
|
|
|
Hi,
you can load an image in memory, make a thumbnail of the required size, and dispose of
the original image in memory:
public Bitmap GetThumb(string path, int wid, int hei) {
Image img=Image.FromFile(path);
Bitmap bm=new Bitmap(img, wid, hei);
img.Dispose();
return bm;
}
Remark: if wid and/or hei are much larger than 120 and the file does contain a thumbnail,
then the above provides better quality than a simple Image.GetThumbnailImage().
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hello, maybe it's a stupid question, I had a form that before was shown as DialogBox with DialogBox.ShowDialog(); , now my boss want me to dock it on the right side of the main application, how can I do that?
Thanks in advance
Paolo
|
|
|
|
|
I think ShowDialog makes the form modal and as far as I know, you really can't dock a modal window.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi,
I have not done this before, but AFAIK these are necessary steps:
- set Form.TopLevel false
- add the Form to its parent's Controls
I expect ShowDialog() is forbidden (conflicts with TopLevel=false) and
Show() is not necessary, since Form got demoted to a Control now.
You would want to play around with Location, Dock and/or Anchor properties.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks a lot,
how do I get the Main form control in order to do
dialog.parent = mainformcontrol ?
Thanks
|
|
|
|
|
There are several ways, I think I would go for this one:
have the main form perform all, i.e. create the dialog, reset toplevel,
add to its own Controls collection, take care of Location.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
1. Add a SplitContainer where the right panel is your "dock" of the dialogbox.
2. In your code, after instantiate the form, set TopLevel = false, then add the form to the right panel's Control. Call form.Show() after that.
You may need to change the way your main form works. YMMV.
|
|
|
|
|
thanks for your reply, and what should I do about the left one? size it to 0?
as I've asked before how do I get the parent control? have I to pass it as parameter to constructor of the dialogbox? Ho do I get it from main form?
Thanks
Bests
Paolo Ponzano
|
|
|
|
|
can somebody help me to change the window title of a chm file.
i have only the .chm file without any project of type .hhp
dghdfghdfghdfghdgh
|
|
|
|
|
Doubtfull. Have you searched the file with a hex editor ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You can use this[^] to decompile, edit, then recompile chm files.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Posted this in a few newsgroups but haven't had any luck so thought I'd try here.
I have an interesting problem in one of my applications in which a call to
Form.ShowDialog() is causing a complete system lockup. Ctrl+Alt+Delete has
no effect and after a few seconds the mouse cursor will no longer move. I'd
be grateful if anyone can offer any help with this or suggest anything else to try.
I have reproduced the problem on 3 different machines running Windows XP
Pro.
The Form making the call to ShowDialog() is in a .NET 2.0 assembly and is
being hosted within an old VB6 executable via COM interop. The VB6
application contains a form, which hosts a .NET COM-visible control that in
turn hosts another .NET form (without border, etc). This works fine, but I
have an event set up so that when an icon is double-clicked within a
listview on this form, a dialog box should appear.
The dialog box consists of a few buttons and another embedded form that is
being used as a control. This embedded form is also used on the parent form
where it works correctly.
By setting a breakpoint on the call to ShowDialog(), I can see that no other
threads are executing managed code within the process. If I replace the call
to ShowDialog() with Show() then the window appears correctly. If I make a
call to MessageBox.Show() immediately above the call to ShowDialog(), the
dialog also works correctly. If I host the whole thing in a .NET
application, without the COM interop, everything works as it should.
By reproducing the hang within a virtual machine and using windbg to force
it to crash, then analyzing the crash dump,
I've obtained the following stack trace...
nt!RtlpBreakWithStatusInstruction
nt!KiBugCheckDebugBreak+0x19
nt!KeBugCheck2+0xa51
nt!KeBugCheckEx+0x1b
nt!KdpCauseBugCheck+0x10
nt!KdpSendWaitContinue+0x319
nt!KdpReportExceptionStateChange+0x8a
nt!KdpReport+0x60
nt!KdpTrap+0x108
nt!KiDispatchException+0x129
nt!CommonDispatchException+0x4d
nt!KiTrap03+0xad
nt!RtlpBreakWithStatusInstruction+0x1
nt!KeUpdateSystemTime+0x165
win32k!GetRealOwner+0x12
win32k!ZOrderByOwner2+0x7c
win32k!ZOrderByOwner+0xa9
win32k!xxxEndDeferWindowPosEx+0x86
win32k!xxxSetWindowPos+0x101
win32k!xxxShowWindow+0x250
win32k!NtUserShowWindow+0xa1
nt!KiFastCallEntry+0xf8
ntdll!KiFastSystemCallRet
USER32!NtUserShowWindow+0xc
0x646d0a7
0x6472716
0x647254e
0xa050ff5
0xad542b0
Dfd_Client_UI!Dfd.Client.UI.Workflow.TaskManagement.list_FieldClicked(System.Object,
FieldClickedEventArgs)+0x173
[C:\Work\Ims.Core\Dfd.Client.UI\Workflow\TaskManagement.cs @ 294]
Dfd_Client_CommonControls!Dfd.Client.CommonControls.ObjectList.OnFieldClicked(System.Windows.Forms.ListViewItem,
Dfd.Client.CommonControls.ObjectListColumn,
System.Windows.Forms.MouseEventArgs)+0x7d
[C:\Work\Ims.Core\Dfd.Client.CommonControls\ObjectList.cs @ 1625]
Dfd_Client_CommonControls!Dfd.Client.CommonControls.ObjectList.lv_DoubleClick(System.Object,
System.EventArgs)+0x1ce
[C:\Work\Ims.Core\Dfd.Client.CommonControls\ObjectList.cs @ 1918]
0xad2decc
0xad95d85
USER32!InternalCallWinProc+0x28
USER32!UserCallWinProcCheckWow+0x150
USER32!DispatchMessageWorker+0x306
USER32!DispatchMessageA+0xf
MSVBVM60!ThunderMsgLoop+0x87
MSVBVM60!CMsoCMHandler::FPushMessageLoop+0x19
MSVBVM60!SCM::FPushMessageLoop+0xb9
MSVBVM60!SCM_MsoCompMgr::FPushMessageLoop+0x2b
MSVBVM60!CMsoComponent::PushMsgLoop+0x26
MSVBVM60!ThunRTMain+0x9b
ims!__vbaS+0xa
|
|
|
|
|