|
That bad, huh?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi,
I have one application that have one Mdi Form, and i would like to list all my open forms in a List View control.
Thanks.
Roberto
|
|
|
|
|
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 )
|
|
|
|