Click here to Skip to main content
15,179,951 members

Comments by supernorb (Top 153 by date)

supernorb 10-May-13 11:54am View
   
Wow, this is really worth trying. I even didn't think about this. But now I'm still a beginner programmer. I will use this solution when I'm a professional programmer. Thank you for the suggestion.
supernorb 1-May-13 7:39am View
   
I didn't think this question of mine could be answered by someone. Well, it's a long time ago. I chose the Second (#2) method in my list mentioned in my question for my application (a Simple Paint like MS Paint) and it seemed to work OK. I just asked this question to seek for a better solution if it does exists. I can see that your idea is great. If calculating carefully and combine with the second method of mine, they can improve the memory issue much. Thanks for sharing. However, I may try this in another project of mine. The project which I was working on when asking this question was already done successfully (I think so). :)
supernorb 26-Apr-13 13:38pm View
   
The Column HeaderText is easy to set, but the Row HeaderText is something new, I think it's not headerText, it's like header text and it's just the first column of your DataGridView. If so, your job is not too hard to do, the remaining problem is how you fetch your data for each table, it's a query related problem.
supernorb 26-Apr-13 13:03pm View
   
Wow, too much code, I bet you have to wait for a long time before anyone considering your code and give some answer.
supernorb 26-Apr-13 13:00pm View
   
Can't understand exactly what you want, however I don't want to vote you down :), even I want to give you my vote of 5 now =))
supernorb 23-Apr-13 7:47am View
   
Really? Well, it looks like that, I also think it can't be done that way (but not sure) and that's why BindingSource exists. Thanks!
supernorb 18-Apr-13 21:35pm View
   
I don't think this design is fluid, it's for Windows Forms, a wrapper of Win32 and it won't never change, maybe WPF has a different design. In fact I've found at least 2 solutions for this. A one is exact and the other is nearly exact (the difference from the exact one is very small). The exact solution has some lines of code while the other has only 1 line, simply I've tried using Font.SizeInPoints instead of Font.GetHeight() in the code I posted in my original question. Maybe you have switched to WPF for a long time and already forgot Windows Forms, I'll never get rid of Windows Forms except its .exe can't run on the new Windows OSs in future. However I can't also stand jumping into the world of WPF. Thank you!
supernorb 18-Apr-13 8:20am View
   
Deleted
Hey, you voted down me? wow what a bad guy, it's a good answer.
supernorb 18-Apr-13 8:19am View
   
Thank you Dave Kreskowiak, anyway I would like to thank you because you let me know the real transparency in WPF, that has encouraged me more to visit the world of WPF. And I would like to accept your answer for that. Thanks =)
supernorb 18-Apr-13 8:16am View
   
Sorry Dave Kreskowiak, I don't want it to be so real transparent. I only want it to be transparent to the background of the parent not to anything behind it. And I said it worked, it's not illusion.
supernorb 17-Apr-13 14:02pm View
   
There are many questions about Focusable Label??? And here, this is a good start point to create your own Focusable Label. It's so simple. Ha ha
supernorb 17-Apr-13 13:42pm View
   
I love Windows Forms so much, don't want to get rid of it, and I'm sure to say I will love WPF for its features I can benefit from. But I'm asking this question for a solution in Windows forms, Oh WPF is my new world of programming windows. =))
supernorb 10-Apr-13 6:01am View
   
I know this is too outdated but I just want to give my vote of 5 to you for the suggestion of using alias. Thanks.
supernorb 9-Apr-13 3:48am View
   
Thanks, what they said in that thread is almost the same to what Zoltán Zörgő answered.
supernorb 9-Apr-13 3:46am View
   
Thank you for the good links to start with.
supernorb 9-Apr-13 3:33am View
   
Thank you, that's great. Look like that I can't use ADO.NET for my case, because the exported excel files have some formated text (bold, colored)...
supernorb 9-Apr-13 3:31am View
   
Examples of both are fine, thanks.
supernorb 5-Apr-13 8:46am View
   
SQLite is something new and cool except that I can't even add Relationships with constraint rules like 'On delete cascade' and 'On udpate cascade', After creating the relationships, it can't help us to not make any conflict whereas a Foreign key constraint should do help.
supernorb 26-Mar-13 8:57am View
   
Reason for my vote of 1 \n Can't interact with the treeview.
supernorb 23-Mar-13 13:09pm View
   
Of course, that's what I did, I also tried DataSet.DefaultViewManager.DataViewSettings["tableName"].RowFilter = "..." and of course this is likely the same to your solution, can't understand why it doesn't work, except the DataGridView's DataSource is a DataTable, a BindingSource, but in my case, it is a DataSet (and use DataMember to specify what table it's bound to). Thanks!
supernorb 23-Mar-13 13:05pm View
   
Selecting of course works OK, however that's not what I want, selecting rows may lead to memory and performance problems, filtering is just a different thing. Thanks.
supernorb 22-Mar-13 3:06am View
   
My code is too long, I just asked this here for help if anyone has any experience on this. If no I'll solve the problem myself. Thanks.
supernorb 21-Mar-13 18:58pm View
   
Your filter string should be modified as "Fullname like '% xyz %'", it's for a word, not any string, however this will work only when you already have the whole word input from user. The case I want here is filter for the last word only and the string will be "Fullname like '% xyz'", this is also mentioned in my question and it can't help. If we have the whole word xyz, it does work, however if user types in the first character of the last word, the filter will filter for all rows with the words having that first character as the last character, please read my original question carefully again. Thanks.
supernorb 21-Mar-13 18:47pm View
   
I don't think the datasource can matter anything here, I just created a table with some columns in a SQL server database, connected to the database and filled the table in a dataset using adapter, the underlying datasource is a DataSet, however to filter data I created a BindingSource and assigned its DataSource to the dataset and its DataMember to a table name in the dataset. The direct datasource here is a BindingSource, maybe I misunderstood what datasource you wanted to mean, because I'm interacting with a BindingSource, I don't think the kind of the underlying datasource can matter (any), That's why the term 'class' in programming is very interesting, If you think of another approach for filtering without using Filter property of BindingSource, please state it clearly before asking the question. Thanks.
supernorb 19-Mar-13 17:57pm View
   
My datasource can be any but it's assigned for DataGridView through BindingSource, and BindingSource has a property called Filter.
supernorb 19-Mar-13 17:55pm View
   
I'm sorry but are you sure the code in those samples has anything for me to refer to achieve what I want? I've tried running the samples but they filter another way (the whole text), I haven't looked deeply in code, if possible please give me an exact solution, I don't think it can't be briefed in some lines of code. By the way, could you please tell me how to find source code on Microsoft? (like as the link you suggested), I would like to know some category or zone in Microsoft for source/sample code only (dedicatedly not mixed with other contents and can only be found by searching). Thanks!
supernorb 18-Mar-13 8:08am View
   
But as you said even when using Dispose() the memory shown in Task manager is still not decreased, if so my application may use up to 300-400 MB
supernorb 18-Mar-13 6:25am View
   
But what I want is it can reduce the memory viewed in Task Manager, does your solution mean that we shouldn't use Remove(), RemoveRange() methods of List class? Thanks!
supernorb 18-Mar-13 4:52am View
   
Thank you, I have known of this before but really don't know why I could overlook it. Thanks.
supernorb 12-Mar-13 19:18pm View
   
As I said, that's a solution I could think of, I have no other choice, please notice that it's a Transparent textbox, if you have another solution better, I would like to see how it is (some link is OK), thanks.
supernorb 10-Mar-13 21:36pm View
   
That's what I want, for example, when user holds left mouse down on the textbox, it is hidden and the fake starts working, the user can move the fake like as move the real textbox with a higher performance (especially when the textbox has a transparent background), then after the user releases the mouse, the fake is hidden and the real textbox shows again. Thanks.
supernorb 10-Mar-13 21:21pm View
   
You can imagine this context, there is a textbox on a form, it has a blinking caret of course, but now I want to create a faked textbox image when the textbox is invisible, however it doesn't have a caret blinking at the end, and that's why I have to create a new caret for the fake (of course also for the form), the new caret should be located at the exact position of the hidden caret. I hope now you understand. Thanks
supernorb 10-Mar-13 21:14pm View
   
I think you shouted a wrong word, WPF not WTF =)))
supernorb 10-Mar-13 19:29pm View
   
The code I posted is clear that I used GetCaretPos to calculate the position at which I want to locate the new caret. I think any window has only 1 caret, it can have many textboxes but there is only 1 caret at a time (the caret will belong to the focused textbox), that's why some the Win32 api functions related to Caret such as GetCaretPos, SetCaretPos, GetCaretBlinkTime... don't have a Handle as an argument, the Handle here is understood as of the current process which calls the functions. So the caret here is of the form as well as of the textbox (if the textbox is focused), and that means hiding the textbox doesn't matter creating a new caret, this new caret is not of the hidden textbox, it is of the form. I'll try using some methods of TextBox instead, however as you said your code seems to show that GetCaretPos works like as using some methods of TextBox, I'm sure it doesn't work. There is something I can't understant here. I have thought of DPI problem, yes my computer is set to a high DPI (the normal is 96, but it's now 125). I'll try this then. Now, I'm very tired! Thanks.
supernorb 10-Mar-13 15:22pm View
   
Please read my question carefully, I said that getting the Width is OK, I didn't say how to do, but actually the way I used is the solution you suggested here, but that's the Width, the Height is different, the Height of SizeF is the real height of the character in the specified font, but I don't want its real height, please read my question again (the example about a line of 2 letters A and B with different font sizes). You can imagine that in a line, we have many letters with different font sizes, what I want is the maximum height of charaters in that line, all the characters in a line should have the same Height (the Height of each character's rectangle/bounds). Looping through each character in a line is not easy, because a line here is not real line (ends with a return character, it is just wrapped) and the performance of looping is really bad. Anyway thank you for the reply!
supernorb 10-Mar-13 15:10pm View
   
It isn't always but that's the case I want to test, why? because that's the case the differnce is maximum. All the measurement you were asking for is by eyes and intuitive feeling, not exact but nearly so. Again, if you don't understand my problem. I'll rephrase it as the following, I have a textbox with some lines (in fact not real lines, because it has no return characters but it's wrapped), the real caret is currently at the end of the text in the textbox. Now by someway, let's get the position of that caret, save somewhere, hide the textbox (the real caret is also hidden), Now, let's create a new caret using CreateCaret, by default its position is (0,0), then please help me how to locate that new caret at the same postion of the hidden caret???? By using any possible. Whereas GetCaretPos and SetCaretPos seems to the most suitable API functions for this but somehow I can't make them work, my code has already been posted for seeing, I've done everything to help others understand my problem. I hope this explanation of mine will help you understand the problem well, if not I have to surrender, this is also asked in stackoverflow and there is currently no reply. Thanks.
supernorb 10-Mar-13 14:57pm View
   
The results from the both methods are the same doesn't mean it works properly. If possible, please help me create a new caret, get the position of the real caret and set that position for new caret, if the new caret is positioned exactly at the same position of the real caret, it works. As I said, we suppose to set the real caret at the end of the text in TextBox with about more 4 lines. Thanks.
supernorb 10-Mar-13 9:49am View
   
greater or equal (equal only when the textbox has 1 line), I forgot saying that the caret is supposed to be at the end of the text in textbox. I don't know how to express how greater it is between a line and another right before it, just a little, but if the textbox has about 4 lines, the difference between the first line and the fourth is about 2/5 of font height. Why don't you try my code above to see it in action? the code needs only a textbox defined. I think GetCaretPos may not wrong but if so, SetCaretPos will be the wrong one. Thanks!
supernorb 9-Mar-13 18:06pm View
   
What if I only want to invalidate a heartshaped region on that Panel? not the whole panel? Yes, it's very simple, just create a heartshaped region and pass it into Invalidate(Region), however that's my code, I can control it, it's invoked intentionally. But what I want is to make that panel invalidated in a heartshaped region no matter what invalidates it (E.g, its parent control). But Zoltán Zörgő suggested me a good link to follow and I think my problem has already been solved. Thanks!
supernorb 9-Mar-13 17:58pm View
   
Thank you for the very good link from stackoverflow. I just read some first lines and thought of e.Graphics in OnPaint, I think the Region (I supposed it was missing) here is e.Graphics.Clip, I think ClipRectangle can't help because the invalidated Region can contain any shape whereas ClipRectangle can contain only a Rectangle. Thanks again.
supernorb 9-Mar-13 17:36pm View
   
How clearer do you want? It should work by its name (GetCaretPos) but it doesn't work correctly. Please review my original post. I mentioned that "the more lines the textbox has, the more different it is between the Position of the real caret and the position obtained by using GetCaretPos. As I said, the X-coordinate is OK but the Y-coordinate obtained by using GetCaretPos is always greater the the real Y-coordinate. (the two are equal when the textbox has only 1 line). Please read it carefully. Thanks!
supernorb 9-Mar-13 15:06pm View
   
The first sentence of my question stated clearly, I want to use GetCaretPos to get the location/position of the real caret, but it doesn't work properly (returns an inexact position). In fact any other solution (without using GetCaretPos) is of course OK, I also post my code to help others understand the problem thoroughly.
supernorb 9-Mar-13 12:55pm View
   
I think my problem was well explained, the code from the first link of yours is almost the same to my code, and the code from the second link seems to calculate the location of caret as indices (horizontal index and vertical index) not a Point structure as I want. Thanks!
supernorb 9-Mar-13 3:32am View
   
I'm sorry but the code from your link is almost the same to mine, except the Attribute for a user-defined structure of Point. And I have also tried that code but it couldn't help (the same to what the code of mine can do). Thanks!
supernorb 4-Mar-13 5:12am View
   
Thank you, I've tried going ahead with my first approach (re-creating GraphicsPath), but the thing has become more complicated than I thought before. So I've tried the second approach (scaling,.., the existing GraphicsPath without recreating) and It's OK now! Please see my solution below. =)
supernorb 3-Mar-13 13:31pm View
   
I think after this comment of mine, you will understand, the context here is to draw a shape (E.g: a right arrow), allow user to resize, move, rotate and the shape should be seen when being in the middle of the process of moving, resizing, rotating. User will input/update parameters by some way (hold mouse down, move, ...as you can see in MS Paint) or even input in textboxes. There are 2 ways to update the shape, the first I mentioned (as clean code) is re-creating the shape with new updated parameters and the second is translating, scaling, rotating the shape (after these transformations, it's still itself not a new instance) but scaling leads to re-positioning problem as I said clearly in the question. Hope you understand it now. Thanks!
supernorb 1-Mar-13 20:31pm View
   
Thank you, the answers from that link can tell me at least a reason for PointF to be used in .NET, but I still don't know how it works differently from Point because as I said that our screen is divided into many rectangular pixels and coordinates are integers. Please wait more for other answers... before I accept your solution. Thanks again!!!
supernorb 1-Mar-13 20:27pm View
   
I mean the difference in usages of the both not in declarations (Why and when using PointF instead of Point ? Don't you think this is a must understand matter for everyone who programs with GDI+ in .NET?). Thanks!
supernorb 20-Feb-13 12:00pm View
   
Thanks, by the way, do you know the size of stack designed in .NET? I can understand my code produces too many entries in stack (most of the entries are the same calls, which is not necessary).
supernorb 20-Feb-13 11:57am View
   
Thanks, I understand, it's just a test.
supernorb 20-Feb-13 10:26am View
   
If so, it shouldn't work in all cases regardless of the size of the enclosed line, however if I draw the enclosed line small enough, it does work.
supernorb 20-Feb-13 10:25am View
   
Do you mean this code can't work? In fact if I draw the enclosed line small enough, it works well, however I think this is because of how the Stack in .NET works.
supernorb 20-Feb-13 9:07am View
   
I'm sorry but what about the if condition? I've drawn an enclosed line (like a circle) and it should stop recursively calling because the color on the enclosed line is not the same to the back color. Thanks.
supernorb 19-Feb-13 13:41pm View
   
Omg, been waiting for 2 days without any answer even a comment!
Please at least anyone reading this question leaves some comment to express your interest or show that this is an interesting question... (of course, a difficult question, I think so)
supernorb 16-Feb-13 12:00pm View
   
Wow, thank you, it is another way to try (beside the one using CopyFromScreen that I mentioned in the last comment). Thank you, you should update this in the your solution to help others who have the same problem with me, I'll accept your solution first. Thanks again!
supernorb 15-Feb-13 9:59am View
   
Your sample couldn't reflect the truth, you can try creating a new Bitmap with the size being the same to dataGridView1's size and passing the second argument as a Rectangle of (50,50,100,100) (of course the width and height of dataGridView1 should be greater than 150), then show the Bitmap, it would be the case more generic than yours.
supernorb 15-Feb-13 8:20am View
   
I don't think the second argument is the rectangle calculated on the panel, it is calculated on Bitmap object (the first argument) and I tried this first, of course it didn't work as I expected! However I tried another method, first create the Bitmap, then obtain a Graphics object from that Bitmap (through the static method Graphics.FromImage), then call the method CopyFromScreen of this Graphics object to Copy/capture the specified rectangle on the panel, because the coordinates are in screen, the coordinates on the panel should be converted to the coordinates on the screen by using the method PointToScreen()... This works well but I still want to find another solution if any one exists. Thanks!
supernorb 13-Feb-13 5:02am View
   
Your code should work but I wonder if it is the only approach to solve my problem? I really care about the performance of drawing. In fact I'm building a MS Paint like application. Thank you for your help!
supernorb 12-Feb-13 11:17am View
   
OK, please see my update! I hope this time you will get what I want to explain! Thank you!
supernorb 12-Feb-13 4:18am View
   
I tested the way you suggested but it is not what I want, in fact I said 'rasteredly' but it is not really 'rastered', I think exactly saying, it is 'vectored by pixel' not by the whole shape, for example, you zoom in the shape by 8x, each pixel of the shape will be zoomed in vectoredly by 8x not the whole shape. I hope you understand what I want, and I'm also sorry for the unclear expression what I want in my question. Thanks!!!
supernorb 12-Feb-13 4:05am View
   
Why do you think it is a bad idea? I want to achieve the same thing when zooming in MS Paint, user wants to zoom in a shape to view the pixels in large scale, if zooming vectoredly, the whole shape is zoomed but the pixels are not. For example, the shape contains 100 pixels, when being zoomed rasteredly it still contains 100 pixels (in larger size) meanwhile it should contain more 100 pixels when being vectoredly zoomed in and less 100 pixels when being vectoredly zoomed out.
supernorb 11-Feb-13 12:04pm View
   
Thank you for your update, however I still have some things unclear here, first If you open any exe file using Resource Hacker, you can see there is a Resource type MUI right at the first position of the resource types list, I can't see any MUI type in the types collection in the code above, this MUI type is achieved only by declaring 'type' as string, if declaring it as int (you suggested this), it showed 16 and matching this value to all resource type constants of int (in your updated code), the corresponding resource type is RT_VERSION, secondly, even when I use your 'converter' function between integer numbers and the corresponding Resouce type strings, the result will be only 1 resource type shown (by using your updated code, it is RT_VERSION instead of MUI or 16, and this is the hardest one I can't understand??? It should show me at least some resource types like resource hacker can extracts, I have even tried using a List<string> to add all the resource types found and show the types later, but the result is still only 1 type. I hope you would continue helping me by focusing on the second. Thank you so much for your effort!
supernorb 8-Feb-13 21:13pm View
   
It seems that you tested the code and it worked well? But I did replace those lines of code as you suggested and the result is 16 shown instead of 'MUI', only 16 shown, (hahaa), why is this? I think the param type is type of string, not int, Could you please review your code to find any other things different from my code (except what you suggested to be modified). Thanks! =)
supernorb 7-Feb-13 5:48am View
   
After hours waiting, not just a comment??? This life is so boring, at least to me...
supernorb 30-Jan-13 18:33pm View
   
I think you first should explain to every one what you want it to work generally, giving an input and make an output is a simple scheme. Analyze all cases which can happen for input values, pay attention to special cases ... I think it is not too complicated.
supernorb 30-Jan-13 18:06pm View
   
I think it is still not clear about what you are trying to do and the detail of your code. I think many answerers in codeproject want to vote you down for questions like this, but I'm an exception. Don't want to vote down anything, anyone... =)) However if there are dozens of down vote, I will feel happy to add more one of myself to that thing.
supernorb 28-Jan-13 8:58am View
   
Oh, I might do wrong not like your instruction, instead of assigning 'N2' to DefaultCellStyle.Format of the numeric column, I assigned it to DefaultCellStyle.Format of the DataGridView. That's why my next issue occured.

Thank you for the helpful comment! I haven't any issue anymore now.
supernorb 15-Jan-13 6:43am View
   
Thank you, you really helped me out. Could you give me more reference about this kind of format using for DefaultCellStyle.Format? I want to share with you a little nasty problem with your solution, in fact my datagridview has also a column of DateTime, the strange thing is when applying the defaultcellstyle.Format as 'N2', the columns of decimal or float are displayed well as I expect, but the column of DateTime doesn't show strings of DateTime, instead it shows values of N2, but I added a CellFormatting event handler for my datagridview to handle this and it is OK, I highly appreciate you if you have any other better solution for this, and some explanation for why this happens to column of DateTime if possible. Thanks again!
supernorb 5-Jan-13 6:06am View
   
Thank you, the links you gave me are really helpful, I thought there was an easier way to achieve what I want but it is not, maybe I will have to research more on that approach. Thanks again!
supernorb 3-Dec-12 5:51am View
   
Not really, I got it and it here is how to use FireBug add-on, not my problem, =)) but this is enough for me. I don't think this is simple to me, just see my 2 other comments below.
supernorb 3-Dec-12 5:48am View
   
With the help of FireBug, I've learned that they use 'html.push()' (don't know what it is, maybe a method of html object in jQuery?) to add content dynamically to the html page, yes, they has a function to push 'Your search...' to html page and that function is saved in a js file and loaded from another location. The problem turns that why the content added by 'html.push()' can be hidden in source code of the page? Maybe after learning jQuery, I will understand all the thing. Thank you!!!!
supernorb 3-Dec-12 5:33am View
   
Can't find the text in the source code, but when trying copying all the source code to Notepad and save as .html file, open that html file and it shows exactly the same what I see in the original file, of course the 'Your search' is there. I can see it, can't find it... What a strange thing. OMG!!!!!
supernorb 3-Dec-12 5:28am View
   
I've learned programming web just for 2 months, but my understanding about the relationship between the page's representation and its source code has formed for years. FireBug is quite nice, I like it, it helps me find where the 'Your search' is but I still don't understand why that text can't be found in the normal source code, even the DIV tag enclosing the whole sentence... there are many other elements which I can't find in normal source code, just in FireBug's window. Thank you for the good add-on.
supernorb 3-Dec-12 5:16am View
   
OK, I got it. Thanks. Sometimes I ask too soon before solving the question myself. Thanks again.
supernorb 3-Dec-12 5:13am View
   
But there isn't any explanation, OK. Now, could you tell me a simple step to use an add-on in FireFox, I've never used a one before. Thanks! Of course, I've installed the add-on successfully.
supernorb 3-Dec-12 5:08am View
   
Do you mean we can't explain the problem here? I really don't understand why you can't see the words 'Your search' on the site at the link I posted. Anyway, thank you, I'm going to install the add-on you've given.
supernorb 3-Dec-12 4:56am View
   
No, I don't have any account logged in involving this site! I've my Google account logged in all the time, but I don't think that site has any association with Google.
supernorb 3-Dec-12 4:50am View
   
Really? If you want I will print my screen and let you see the text in a red circle. The whole sentence is "Your search viphalong did not match any documents". Please recheck it! Thanks!
supernorb 19-Oct-12 9:17am View
   
I tested my code to see which controls are removed in a loop and the result is something a little interesting:
1st loop: 0,2,4,6,...,26,28 are removed (step up by 2)
2nd loop: 1,5,9,...,25,29 are removed (step up by 4)
3rd loop: 3,11,19,27 are removed (step up by 8)
4th loop: 7,23 are removed (step up by 16)
5th loop: the last one of 15 is removed.

Do you have any idea on this? Thanks!
supernorb 19-Oct-12 9:16am View
   
Deleted
I tested my code to see which controls are removed in a loop and the result is something a little interesting:
1st loop: 0,2,4,6,...,26,28 are removed (step up by 2)
2nd loop: 1,5,9,...,25,29 are removed (step up by 4)
3rd loop: 3,11,19,27 are removed (step up by 8)
4th loop: 7,23 are removed (step up by 16)
5th loop: the last one of 15 is removed.

Do you have any idea on this? Thanks!
supernorb 19-Oct-12 9:04am View
   
Great!!! Why didn't you post it as your answer? Yeah, your idea is also OK. But again, I can't understand why my code doesn't work. As OriginalGriff said, it is odd with a foreach, but I ran the code and it did remove some of the controls, not all but there wasn't any exception. Thanks!
supernorb 19-Oct-12 8:54am View
   
Thanks, yours works great. I tried with while(Controls.Contains(control)) in each loop of the foreach loop but it didn't work. You've solved my problem but the reason why the code I posted couldn't work as it should is still not clear. Do you think it is a bug? Thanks again!
supernorb 19-Oct-12 8:48am View
   
Thanks, I also tried with for(...) instead of foreach, but it is the same. I think the solution of Frederico Barbosa is OK, but the oddity is still there? Why can't it remove the control right after calling to Controls.Remove()? Again, the problem seems to occur only in for loop not with a single call.
supernorb 8-Oct-12 17:45pm View
   
As I said, the only reason I use PictureBox is it has SizeMode property, with other controls, I have to customize to use the same property. Thanks!
supernorb 8-Oct-12 16:29pm View
   
About PictureBox, I really can't find any other control which can replace it, I like the SizeMode property of it, could you please suggest me with any other control which has the same property or I have to customize a picturebox myself? Thanks!
supernorb 8-Oct-12 16:09pm View
   
It seems that my question may be ambiguous but I found some words that make it clear "display in a picturebox", that meant I wanted some code here not the way you suggested, anyway you gave me a solution which may be helpful to me some time in the future. If you want I will click the accept solution button, don't you?
supernorb 8-Oct-12 15:13pm View
   
Thanks for the another approach using LoadIcon, it's really helpful! My vote of 5 and also a click on Accept Solution.
supernorb 8-Oct-12 14:00pm View
   
I don't see any code to do, are you extracting icon at design time? That's not I want. What I want is simply a Browse button to select a .exe file and then show the extracted icon of that file on the form! Thanks!
supernorb 8-Oct-12 13:29pm View
   
No accept but my vote of 5! It's not really bad!
supernorb 8-Oct-12 13:27pm View
   
Sorry for the late reply (my network had some trouble). You didn't really point out how to extract icon in an .exe file. And in fact I've found the solutions myself as I said in the last comment. I wish there were 2 accept buttons, a one is for those who deserve it with their correct and helpful answers and the other is for those who want it. Then I would click on the second for you. If you update the answer so that I see how helpful it is, I'll click on the accept button! Thanks
supernorb 3-Oct-12 11:20am View
   
Anyway I still want to use PictureBox to show any image in my Temporary projects, just for convenience. After asking this question, I tried searching somewhere else in the Internet and I found some solutions, some of them was posted in CodeProject. There are at least 3 ways, the first is very simple with using the static method ExtractAssociatedIcon of the class Icon, the other two ones use Win32 API (ExtractIconEx and SHGetFileInfo, both in Shell32.dll). Converting from Icon to Bitmap is so simple with ToBitmap() method. About the intellectual property, I don't think they want to protect their application icons from people because if the 'stealers' want they can search for those in the internet easily with high quality images not only icons of 32x32. And the most suitable case you may want to extract application icons is for example when you create an application managing a list of your favorite applications and you want to place a representative icon before the application name in each entry. Thanks!
supernorb 2-Oct-12 14:02pm View
   
Sorry, the last comment of mine was made when I hadn't tried changing the build configuration option to Release. After doing so, it works as it should. Thank you very much and of course with my 5.
supernorb 2-Oct-12 13:57pm View
   
If so I have to do that every time I create new project? My computer always shows hidden files, I like so, and I don't see any file with .suo extension in my projects. Anyway, thanks for the 'unsafe' using explanation.
supernorb 30-Sep-12 8:21am View
   
You can store the paths to your image files. That's the easiest way to do. Another way is to convert your Image objects to arrays of byte using seriralization, then insert these arrays of byte into some column of binary/varbinary/image in your table. This is also not too difficult, and you can easily search for that on the internet! It takes about 10 lines of code.
I have updated my solution with an addition about the 2 functions converting between Image and byte[], you can see them as an example.
supernorb 29-Sep-12 17:31pm View
   
This was what I thought about. Now the asker has a good solution!
supernorb 29-Sep-12 16:34pm View
   
Yeah, there are several. Try using Registry, Xml, Serialization...
supernorb 29-Sep-12 16:31pm View
   
The error is so clear enough. You should try checking your query.
supernorb 29-Sep-12 16:12pm View
   
Your code is too strange to me ('cause of using a third party library?). I can see your ArrayList contain objects of IntPtr (pointers), you should convert them to the expected data type.
supernorb 29-Sep-12 16:05pm View
   
I think he means ArrayList of bytes. In fact ArrayList contains objects but he may want these objects to be arrays of byte only (not string, integer...). Everything is 0's and 1's :))
supernorb 29-Sep-12 16:00pm View
   
I don't think I'm qualified enough to help you. I'm also a C# starter. Ah, if my solution helped you, please click on the accept solution button. Thanks!
supernorb 29-Sep-12 15:56pm View
   
Give you a keyword: "Customize DataGridViewCell"
supernorb 29-Sep-12 15:33pm View
   
Well, I think what you need is some tricks with the so-called trigger, but I'm not sure, I've never worked with trigger before!
supernorb 29-Sep-12 15:31pm View
   
You might want to know if whenever a recored is stored (or inserted into) in your database? I think that's what he wants!
supernorb 29-Sep-12 15:24pm View
   
So cloudy! Can't understand your problem!
supernorb 29-Sep-12 14:51pm View
   
I don't have any skype id, I have given my solution to you. Isn't it helpful? or at least solved your problem?
supernorb 29-Sep-12 14:48pm View
   
Likely you are some kind of expert. I've never associated the same thing before. Hope someone else more expert will jump in and give some help to you!
supernorb 29-Sep-12 14:46pm View
   
I visited the link, tried clicking on the Download button (Which is very big on the right side) and I downloaded a sample solution but it didn't work because of missing some dll. Where can I find them? I can't understand why a solution packed for downloading free isn't enclosed with needed dlls? Or at least they should give some instruction to where to download the needed dlls.
supernorb 29-Sep-12 14:27pm View
   
A bit strange, I've never seen this before! Someone may want to downvote you :(
supernorb 29-Sep-12 14:12pm View
   
You should change i after each snapshot being taken!
supernorb 28-Sep-12 0:13am View
   
Likely you are talking about a customized control and of course we can't know thoroughly about that control, so why can we help you? Simply at least you should try giving us a link to download that control dll, taking a photo of the unwanted effect... I can understand why this question hasn't had any answer. Place yourself in our position and you can understand why it has been that.
supernorb 28-Sep-12 0:06am View
   
When you say the button doesn't work with tabpage2 just because of the else clause. You should check if all the code in that else block work well. This is not a problem with the button or tabpage2.
supernorb 27-Sep-12 23:52pm View
   
Don't get what you are asking for at all!
Please explain more
supernorb 27-Sep-12 0:25am View
   
As I said, the important thing is your form should be loaded before changing the cell style of a particular row. As in my code, the datagridview should be filled with data first before validating, if you want to validate the data first, you should store data in somewhere like a datatable and do the same validating algorithm on it instead of on the datagridview. I hope you can easily do that yourself!
supernorb 26-Sep-12 7:54am View
   
Could you please point out or highlight the line where the exception occured? I wonder how fast your database grows in size? :)?
supernorb 26-Sep-12 1:37am View
   
I think he wants to add some control and make it work at run time, for example add a button and subscribe it with some work when it is clicked, the work is determined by the user. Well, this is so general
supernorb 25-Sep-12 14:06pm View
   
Place the code after InitializeComponents() in the form constructor. Of course the important thing is the DataGridViewRow.DefaultCellStyle has to be set or changed after the form is loaded (that's why I placed the style changing code in Load event handler), therefore you can also place that code in a Click event handler of a button (at the time you can click that button, your form should be surely loaded so that's OK). Hope it helps!
supernorb 25-Sep-12 7:14am View
   
Well, what about the sender? the asker wants the sender to be a usercontrol, he might have other purposes with it, not simply a reponse from usercontrol.
supernorb 25-Sep-12 5:20am View
   
I think the best way is to post your code here, I would like to know the hardware API via which you can build your application. Ah, by the way, I think the problem may lie in the hardware API, if so it is not really related to C#, try revising the documentation for that hardware. Hope it helps!
supernorb 25-Sep-12 5:12am View
   
Well, it is also an answer, I think, but not a good answer! hahahahah. Maybe a bad answer is the most suitable to a bad question!
supernorb 25-Sep-12 4:29am View
   
Well, if so I think it is nice to make a loop through all the rows, if it doesn't meet your requirement, then try changing its back color to red. Even if you have another way, I think the underlying algorythm would use a loop.
supernorb 24-Sep-12 16:50pm View
   
Not clear at all, What is the data type of each column? What may the result be after the comparison? How do you want to compare two columns? I think the most primary way is to loop through all the rows and make a comparison at each row, the comparisons at different rows may be different so You have to decide yourself the result of the entire comparison between the two columns.
supernorb 24-Sep-12 16:43pm View
   
Well, I can't imagine these days there are still some people using VB6, if it is .net, I think I can help you!
supernorb 24-Sep-12 16:41pm View
   
It seems that you have some problem in connection string which involves the server name, the server name may also involve the computer name and that's why changing the computer can make your program not work. As others suggested, you should post some of your code in which you think the problem might be.
supernorb 24-Sep-12 16:35pm View
   
Hey, I would like to see your code, could you please post it here? Thanks
supernorb 18-Sep-12 9:58am View
   
Yeah, thanks, I thought it can be used somewhere else
supernorb 17-Sep-12 13:28pm View
   
Thank you, why didn't you give your answer to my question?
Yeah, my drive didn't have any disk, and after inserting a one, it worked! Thanks again!

However, my CD Ejector became useless when it can't eject my CD Drive when the drive has a disk, I just tested when the drive didn't have a disk. I collected the code at StackOverFlow, well, it seems to be rather complicated, I used winmm.dll and it works well, but with CreateFile and dozens of other functions don't work!
supernorb 17-Sep-12 13:15pm View
   
Of course, the cd.IsReady is false, but in fact there is not any problem with my drive, it is still working properly.
My want is how to get the VolumeLabel of a CD ROM drive, my approach using DriveInfo seems to be not feasible, Thanks
supernorb 17-Sep-12 13:05pm View
   
I don't know what UNC path is, but "\\.\F:" does really make sense in my case, the CreateFile function can be executed successfully with it passed in as the first argument (filename) but not with "F:" (which is the most meaningful ???) passed in!
I don't think they are the same, of course at least to the way CreateFile works!
supernorb 17-Sep-12 13:01pm View
   
Yeah, you are right, but could you please be more elaborated on the meaning of "\\.\F:", I really don't understand what it is? (Of course the "F:" is my CD drive, but what about the prefix???)!
Thank you so much, you deserve my click on the accept solution button!
supernorb 17-Sep-12 12:58pm View
   
Please read my question carefully, If I passed the "F:" in, it would say "The device is not ready", but if I passed the @"\\.\F:" in, the CreateFile would excute successfully and return a handle to the drive F which I call "Drive handle", this is then passed into the API function DeviceIoControl, (I'm talking about my CD Ejector application).
Thanks!
supernorb 17-Sep-12 10:57am View
   
I have tried TKinter, It doesn't support drag-n-drop design feature, that's why I ask this question, can't understand why such a framework can attract some developer, it is even not worth to be compared to Assembly, because Assembly is a low level programming language but Python and its Tkinter are kind of high level programming. We have .NET languages, Java with great IDEs supporting drag-n-drop design feature so why go for Python and TKinter??? (and other the likes?)

Thank you for the link, I just have to learn Python, it's not my interest!
supernorb 14-Sep-12 5:05am View
   
Thank you, the way you mentioned about configuring the Apache server to achieve my goal is nice, but I think there's another way that I read from my book (using the 3 lines of code above), I want to make it work and it seems to have something wrong here, I really don't want to include the "cgi-bin" in the path to the resources.
supernorb 31-Aug-12 15:08pm View
   
Yeah, you gave me a great link to solve my problem, and you possibly knew what's wrong in my HelloPython.py, I thought it was the same to PHP.
This is a so-called direct solution, Thank you very much!
supernorb 31-Aug-12 14:58pm View
   
I think you guided me to choose another solution than give a direct solution for my problem. My example is very simple which is needed to work as it should do, however I will try your solution after I solve this. Thank you!
supernorb 23-Aug-12 1:29am View
   
Well, I think so, but I don't know how to solve it using just javascript and PHP, unfortunately I have never learned jQuery although I've heard of it for years.
Is there a solution without using jQuery? I have read somewhere on the internet that they set some header info to invalidate the caching on client side, it may be the solution for me.
Thank you!
supernorb 10-Apr-12 14:33pm View
   
Thank you, I'm sorry to say that all your suggestions didn't make any change, the error was still thrown.
I think SqlConnection can't be created in PHP, any way thank you so much, it seems that you are a pro of asp.net, and I'm going to learn asp.net soon or later, then I will need your help much.
supernorb 4-Apr-12 2:42am View
   
Thank you! I tried with var_dump, it said "bool(false)", even var_dump was placed in while loop, I can't understand why it couldn't be broken before var_dump was executed, (the condition values false). Do you have any idea?
supernorb 29-Mar-12 23:53pm View
   
Sorry, I have never tried refering how odbc_fetch_row is defined, looking at its name I guess it is the same to odbc_fetch_array, and in fact I coded using odbc_fetch_array, it returns an array, right? I'm sorry about my misunderstanding between those function, I'm editing my first post to change odbc_fetch_row to odbc_fetch_array, please review my problem.
Thank you for your help!
supernorb 29-Mar-12 20:58pm View
   
No, I don't think so. I have experienced programming with .NET for months and I have already installed Framework 3.5 on my computer going with VS 2008. The error message is long but it contains my url and that's why it is long, I think the what I posted is the most important. You can reproduce my error message simply by typing only one line of code that I posted (creating a .net object using DOTNET constructor). There was no other code involving here, I'm sure because I tested with only that line in a php file.
Thank you for your help!
supernorb 27-Mar-12 14:10pm View
   
Thank you!
I should've noticed the definition of InvokeMember method.
supernorb 4-Jan-12 20:34pm View
   
Thank you! You gave me a very short way of creating new thread with arguments, I have already known how to do it another way longer but how it is done is not important, I want to know what we have to do if happenning a cross thread exception? The normal way I see others use for this is to check if InvokeRequire, we call Invoke with a delegate of MakeGrey and some arguments passed into, the problem shows up here is I have 3 arguments for 3 speparate threads (a1, a2, a3). Suppose if thread 1 requires invoke, I should know it to call Invoke(ParameterizedThreadStartOfMakeGrey, a1) only not all calls with all a1, a2, a3, shouldn't I? That's my problem. Or if you can tell me how to avoid cross-thread exceptions, please do it as a favour for me!
Thank you!
supernorb 27-Dec-11 0:23am View
   
You are right, it is my fault. Please see my comment to SA's solution.
Thanks!
supernorb 27-Dec-11 0:21am View
   
I'm sorry, I have found this is for my adding twice the handler to tick event. So it is decreased by 1 twice nearly simultaneously making me think it is decreased by 2.
Thank you!
supernorb 24-Dec-11 15:42pm View
   
Thank you so much!
I have just known of a new tech from you.
supernorb 24-Dec-11 15:22pm View
   
Thank you, I just think that we can't do something like someinterface = new someinterface()
in .NET, the way above is how an object of someclass is created. If in .NET, it should be someinterface = (someinterface) new someclass() in which someclass has to implement someinterface otherwise an exception will be thrown.
As you can see, that kind of 'interface' is too strange to me and I didn't care much about that and treated it as normal class in .NET.
About the TextInput, I'll check it soon, I don't think there is any object in MS Word that doesn't have a mapped class in Word Interop library. Thank you for your help.
supernorb 23-Dec-11 22:48pm View
   
That would work greatly. But do you think the database size will double the normal size?
Or that is the expense we have to accept? Don't we have any other ways?
If not, I would use that way and thank you for the great solution.
supernorb 23-Dec-11 1:50am View
   
OK, I have tried your keywords with both Google and Bing but it seems that all the results are duplicated in content and only Introductions to Word automation with general and outlining knowledge of Word Automation. Not easy to find a systematic downloadable tutorial on Word Automation, the online one is rather good can be found in MSDN as you suggested me.
Thank you.
supernorb 23-Dec-11 1:43am View
   
OK, I'll try it, ah We'll try it, won't we?
supernorb 23-Dec-11 1:11am View
   
OK, if you have worked with Word Automation, I think you would figure out what I want. For example, I add a paragraph to the current document as Paragraph P = MyDoc.Paragraphs.Add(someBookmarkedRange); P.Range.Text = "someText"
The code above will add a paragraph with content of "someText" to MyDoc at the bookmarked range (the specifed location in the document MyDoc), but now I want to add some bullet and nunbering to that new paragraph like as you select that paragraph and choose from bullet and numbering style menu in Word Interface.
Hope you understand my scenario.
Thank you!
supernorb 23-Dec-11 0:59am View
   
Your first link leads me to another solution than using Word Automation, it seemed that using Word Automation is too complex so that an expert in StackOverFlow suggested another way using Open XML and I have known of it but I will use it in my later projects, now I want to use Word Automation only.
Thank you.
supernorb 22-Dec-11 14:07pm View
   
I can see there is a relationship between codeproject and microsoft (but I really can't make it more specific), and I think most of programmers (not except you) are experienced mainly in .NET and other Microsoft's technologies, and so I think you and I should type 'www.bing.com' in the address bar of Internet Explorer whenever we want to search for something instead of typing 'www.google.com' in the address bar of Google Chrome.
What's your idea?
Thank you!
supernorb 22-Dec-11 13:58pm View
   
Although that's not something downloadable like ebook of .pdf, but your link is really helpful to me, if possible, could you update your answer with links to download tutorials in .pdf (or in many other popular formats) if you find any?
Thank you!
supernorb 22-Dec-11 13:51pm View
   
Thank you!
I have googled for hours without finding any stuffs downloadable in .pdf or .chm or .doc, that is what I really want not online tutorials (require Internet connection while reading and learning).
Maybe my searching skill is too bad and that's why I need your help. I think you can publish a pdf version of some tutorial on Word Automation with your experience. I hope to get a download of it.
Thank you!