|
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
|
|
|
|
|
Not part of the same debugging session, but I've also got the below info from !analyze -hang -v if it helps. I've no idea what to make of it though, I don't know what resource 0x822e6e08 is, or why the thread is blocking itself.
BLOCKED_THREAD: 82368868
BLOCKING_THREAD: 82368868
LOCK_ADDRESS: 822e6e08 -- (!locks 822e6e08)
Resource @ 0x822e6e08 Exclusively owned
Contention Count = 6148
NumberOfExclusiveWaiters = 10
Threads: 82368868-01<*>
Threads Waiting On Exclusive Access:
820e46a8 822dca30 82284578 82197978
82099260 820bf238 820cc970 820c88b8
82279da8 8205db98
1 total locks, 1 locks currently held
BUGCHECK_STR: LOCK_HELD
LAST_CONTROL_TRANSFER: from 804e3324 to 804e3592
FAULTING_THREAD: 82368868
STACK_TEXT:
f4e65b88 804e3324 00000001 00000000 00000030 nt!RtlpBreakWithStatusInstruction
f4e65b88 bf837de5 00000001 00000000 00000030 nt!KeUpdateSystemTime+0x165
f4e65c10 bf838242 bc669740 f4e65c70 e19d7024 win32k!GetRealOwner+0x15
f4e65c38 bf8380ec bf9aaf60 00000000 bf9aaf60 win32k!ZOrderByOwner2+0x7c
f4e65c84 bf827739 00000000 00000000 bc669740 win32k!ZOrderByOwner+0xa9
f4e65cdc bf82a3da 00000001 00000000 00000000 win32k!xxxEndDeferWindowPosEx+0x86
f4e65cfc bf83910d bc669740 00000000 00000000 win32k!xxxSetWindowPos+0x101
f4e65d30 bf839486 00000000 00000043 f4e65d64 win32k!xxxShowWindow+0x250
f4e65d54 804de7ec 00010304 00000005 0012f994 win32k!NtUserShowWindow+0xa1
f4e65d54 7c90eb94 00010304 00000005 0012f994 nt!KiFastCallEntry+0xf8
0012f970 7e41d8b0 06456819 00010304 00000005 ntdll!KiFastSystemCallRet
0012f994 0646d0a7 0012f9d8 00000005 00000000 USER32!NtUserShowWindow+0xc
0012fa64 06472716 032856d4 00000000 00000001 0x646d0a7
0012faa4 0647254e 0a041383 00000000 030e2ce4 0x6472716
0012fb04 0a040ff5 0336b50c 00000000 032856d4 0x647254e
0012fb34 0ab95236 0336b50c e5dc581d 79e71998 0xa040ff5
0012fc18 0ab0e3fb 0314eb04 0314b804 03234438 0xab95236
0012fc40 0ab0e20d 032856c0 00000000 0324bebc 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]
0012fc64 0ab0e8a6 032856a4 03219004 0314f718 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]
0012fcc0 0ab0e6c4 030d4fc4 00000007 0314f718 Dfd_Client_CommonControls!Dfd.Client.CommonControls.ObjectList.lv_DoubleClick(System.Object, System.EventArgs)+0x1ce [C:\Work\Ims.Core\Dfd.Client.CommonControls\ObjectList.cs @ 1918]
0012fcd4 0ab65e15 00000000 00050006 0012fcfc 0xab0e6c4
0012fd74 7e418734 00020270 00000202 00000000 0xab65e15
0012fda0 7e418816 02ef7662 00020270 00000202 USER32!InternalCallWinProc+0x28
0012fe08 7e4189cd 00225978 02ef7662 00020270 USER32!UserCallWinProcCheckWow+0x150
0012fe68 7e4196c7 0012fe90 00000001 0012feb8 USER32!DispatchMessageWorker+0x306
0012fe78 73434d53 0012fe90 ffffffff 0153373c USER32!DispatchMessageA+0xf
0012feb8 73434c8c ffffffff 01533764 01530000 MSVBVM60!ThunderMsgLoop+0x87
0012fecc 73434c2e 0153373c ffffffff 01533834 MSVBVM60!CMsoCMHandler::FPushMessageLoop+0x19
0012fefc 73434b6a 01533834 ffffffff 000007f8 MSVBVM60!SCM::FPushMessageLoop+0xb9
0012ff18 73434b35 01533760 01533834 ffffffff MSVBVM60!SCM_MsoCompMgr::FPushMessageLoop+0x2b
0012ff3c 7342ded9 ffffffff 00390039 00320038 MSVBVM60!CMsoComponent::PushMsgLoop+0x26
0012ffb8 0041dede 00422b40 7c816fd7 00390039 MSVBVM60!ThunRTMain+0x9b
0012fff0 00000000 0041ded4 00000000 78746341 ims!__vbaS+0xa
STACK_COMMAND: .thread 0xffffffff82368868 ; kb
|
|
|
|
|
After I finished converting(with visual studio 2005 automatic convertor) a windows application written in vb.net 2002 to vb.net 2005
I recieved few syntax errors that I did not find a sulution for them yet.
The first one is:
The error line - If TypeOf Me.WorkingTable.Column(i).DataType is Boolean Then
The error message- Expression of type 'system.Type' can never be of type 'Boolean'.
|
|
|
|
|
Not sure, but try this:
If Me.WorkingTable.Column(i).DataType is Boolean Then
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
|
|
|
|
|