|
Thanks For Replying ,
I used ur code in my task . I am getting the things well in the propertygrid ,But it is not looking way in vs2005 .But i am very thankful for ur help . if i take a normal textbox1 at design time andi if i assign the propertygrid.selectedobject =label1 it is displaying in order everything .But the code u gave is showing in 2 properties + icons ,If user has to click those icons and then he can see the properties . I want to assign normally .I use like this .
1) But whenever i am right clicking the on the panel--> i get contextmenustrip in that i added properties .If i click i wrote like this
If (ctrl.GetType().ToString() = "System.Windows.Forms.Label") Then<br />
Dim d As ContolData = New ContolData(ctrl)<br />
PropertyGrid1.SelectedObject = d.Control
i am adding the controls to combobox1 when mouse down on the control . i am displaying when the particular runtime control is clicked using the code like this : and showing in both combobox and propertygrid
ComboBox1.SelectedItem = ctrl.name<br />
Dim cd As ContolData = New ContolData(ctrl)<br />
PropertyGrid1.SelectedObject = cd
using this code i can add the controls at only one time .
but it is working for all dynamic controls except for panel or splitter1.panel1 ,it is showing error Object reference not set to an instance of an object. i dont know how to get for panel . Using ur code i can display the controls incombobox but i am not able to display in propertygrid when particular item is selected in combobox1
2) When i am selecting an item in combobox1 . i am not able to get the properties in propertygrid of that particular item i.e, in ComboBox1_SelectedIndexChanged,i am getting error as "Object reference not set to an instance of an object".Bcoz ,if i take it as control it is displaying in propertygrid .
3) Exactly my task which looks like creation of controls in vs2005 (drag drop,everything for properties same) but it is has something more but all these things i have to create on pages like page1 ,page2 ...and save with a name . And i have to set the page1 properties i.e., width and height so that it can appear one like in word doc . A4 (sizes) ,A3
Waiting for ur Reply ......
DVSRIRAM
|
|
|
|
|
dvsriram wrote: But the code u gave is showing in 2 properties + icons ,If user has to click those icons and then he can see the properties . I want to assign normally .I use like this .
I have no idea what this means. When I do it, I get the full public properties. i have no idea what you did, or didn't do to not get the property grid as normal.
dvsriram wrote: If (ctrl.GetType().ToString() = "System.Windows.Forms.Label") Then
Dim d As ContolData = New ContolData(ctrl)
PropertyGrid1.SelectedObject = d.Control
These three lines alone tell me you don't have the experience required to design and write a forms designer. The problem is that hosting the real Visual Studio Forms designer is probably more complex than writing one yourself!
The first line should read
If TypeOf ctrl Is Label Then
after that, you're doing something that isn't even necessary, but I can't tell you what it should be because there is a lack of context. I have no idea what this code is supposed to be doing, nor do I know what the code around it is, so it's impossible for anyone to tell you why you're getting this message.
dvsriram wrote: 2) When i am selecting an item in combobox1 . i am not able to get the properties in propertygrid of that particular item i.e, in ComboBox1_SelectedIndexChanged,i am getting error as "Object reference not set to an instance of an object".Bcoz ,if i take it as control it is displaying in propertygrid .
Without seeing the code in the SelectedIndexChanged event, it's impossible to tell you what's wrong. But the question leads me to believe that you don't understand your own data model.
dvsriram wrote: 3) Exactly my task which looks like creation of controls in vs2005 (drag drop,everything for properties same) but it is has something more but all these things i have to create on pages like page1 ,page2 ...and save with a name . And i have to set the page1 properties i.e., width and height so that it can appear one like in word doc . A4 (sizes) ,A3
Oh God! I'm sorry to say that your inexperience is going to prevent you from doing this. We could go back and forth in the these forums for a year and still not have a working designer. You're trying to run a marathon and you've just barely learned to walk.
The designs I've seen for this would require you to scrap everything you've already done, and start over. The problem with this is that it would take about 5 chapters of a book to explain it. This just can't be spelled out in a few forum posts.
|
|
|
|
|
Thanks For Replying me Immediately ,
Now i got the output as you told , But i will try to get the things in fast manner and in good way of programming .
Just mention me to know the required things in a well formatted manner . Just mention me some nice books or sites. i have to follow to get good programming skills like you . I want to develop my skills. But i try to put effort to do in good way . I want to write MS exam mcts 2.0 (Windows prgrming) . With ur help anybody can do good .Bcoz ur experienced .
Coming to task , I have to do ,there is no chance to do some other things .
I think you can contribute the same Please dont hesitate to give answers . After trying alot in net ,if i am not getting required output i am asking in this forum .
DVSRIRAM
|
|
|
|
|
Hii
How to disable some of the properties showing in propertygrid at runtime of control like Accessibility ,Behaviour,Data .
Regards ,
DVSRIRAM
|
|
|
|
|
You don't. It'll display every public property in whatever class you give it. The only way to hide properties is to create your own version of whatever controls and hide them through attributes and overrides.
This is what I'm talking about. The kind of skills required to build a designer only come from experience. You'll have to read 100's of articles, books, and websites on everything from interfaces, serialization, code generation, data structures, attributes, design patterns, ... But just reading them won't do you any good. You have to build a bunch of applications using and excersizing these techniques to figure out how all this stuff fits together and how to apply it.
Sure, you can read a bunch of books on metallurgy and mechanical engineering, but that doesn't give you the knowledge to design and build a Ferrari, and that's what you're trying to do.
You want a peek at what it takes?? Try reading these: No, scratch that. Try understanding these:
Hosting Windows Forms Designers[^]
Create And Host Custom Designers With The .NET Framework 2.0[^]
I'd seriously think twice about using this code in your own application. If you can't understand the code, you have no hope of supporting it, nor extending it's functionality.
-- modified at 7:47 Thursday 27th September, 2007
|
|
|
|
|
does this code really put the bitmap image into the picturebox
the picturebox is always black after calling its load method
dim btmp as new system.drawing.bitmap("sam bitmap image location")
picturebox1.image=btmp
picturebox1.load
but doesnt work
thanks in advance
phatkin
|
|
|
|
|
The Load method loads an image from the path specified in the ImageLocation property, replacing the image that you put in the Image property.
---
single minded; short sighted; long gone;
|
|
|
|
|
OK,
So I seem to be one of those rare people that actually converts *back* from Mac to PC. But, what the heck, ya gotta make a living, right?
Over in Mac-land I used to enjoy using Applescript as a way to write simple programs that could automate a lot of mundane tasks. Wondering if it's possible to do some of the same stuff on my new PC.
Specifically, is it possible to:
1) Automate Explorer (or Firefox) to browse the web and download weather images so they're on my machine when i wake up in the morning?
2) Create back ups of specific local folders and ftp them to my web server?
Any suggestions on where to start - books/web sites/etc.. appreciated.
Thanks!
|
|
|
|
|
@largeinsd wrote: 1) Automate Explorer (or Firefox) to browse the web and download weather images so they're on my machine when i wake up in the morning?
You don't need a browser application to request files from the web. Use the WebClient class and the DownloadFile method to download images.
@largeinsd wrote: 2) Create back ups of specific local folders and ftp them to my web server?
That depends on how you want the backup. If you just want to copy the files, that's easy using the File class.
Use the WebClient class and the UploadFile method to send the files over ftp.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
i have 2 forms, frmtools and frmpad
i have created 10 instances of frmpad and loaded them on mdi's load event
now i want to do the operations only if the CurrentChild is any of the instances of frmpad. if the CurrentChild is frmtools then nothing should happen
for that i have set the tag property of frmpad to "yes" and the tag property of frmtools to "no" and written the following:
if Me.ActiveMDIChild.tag = "yes" then dim a as frmpad = me.ActiveMDIChild
it works also.
but, i don't know the use of tag property. will there be any problems due to the change of tag property or is there any other way to achieve this.
|
|
|
|
|
The tag property is just a place to put any piece of data you want. It's not used by anything in the .NET Framework. Think of it as a little box to put anything you want attached to that instance of the form.
There are other ways of doing it, like seeing if the ActiveMdiChild is of a specific form type:
Dim currentForm As Form
If TypeOf(currentForm) Is frmPad Then
Dim padForm As frmPad = DirectCast(currentForm, frmPad)
... do whatever you need to do to the form ...
End If
|
|
|
|
|
thanks for ur help
now its working fine
|
|
|
|
|
I am working on a project that try to extract image color features. I wonder if vb.net can use to perform the function. If that is possible, can anybody tell me how to do it with any sample code?
|
|
|
|
|
There are articles on here telling you how to do this. Christian Graus has done some very good articles (in C#) on how to access images pixel by pixel and apply filters etc. However this involves using pointers so is not really suitable for VB (take a look though as they are useful and show you the idea behind how you would go about doing what you want - the algorithms and methods at least). Check this thread:
http://www.codeproject.com/script/comments/forums.asp?msg=2216444&forumid=1649&mode=all&userid=2578352#xx2216444xx
There are picture box controls as well but they are not very flexible - check out msdn for info though as they may do what you need.
Take a two step approach here - look at how to access the picture at a low level and then look at what you want to do once you know how to do this.
Dan
|
|
|
|
|
Of course, this all depends on what you mean by "extract image ... feature"??
|
|
|
|
|
Thanks 1st of all, what i mean by 'extract image color feature' is to extract the color information of the specific pixel. For example, the pixel of (20,30) of an 800x600 images which contain RGB value = 123 192 134. Once i specify the pixel, then the corresponding value will be given.
|
|
|
|
|
Have you tried the Bitmap objects GetPixel method??
|
|
|
|
|
I'm making datagrid reports in .aspx pages and I was wondering if there was a way to find out how many pages will print before sending them to the printer?
Any help would be appreciated.
|
|
|
|
|
I'm assuming the document will be printed on the web browser side, so no, there isn't any way for your server-side code to know how many pages the client will use to print.
|
|
|
|
|
That sucks.....
Thanks for your reply though
|
|
|
|
|
How is the server going to know which printers are installed?? What paper size is selected?? What the margins are?? Any other Page Setup settings??
It can't! ASP.NET is a server-side only technology that (greatly simplified!) generates HTML/Javascript for client-side use and rendering only. The server code does not, nor should it ever, care about what the client is doing with, or how the client is rendering, the data sent down the pipe.
|
|
|
|
|
I am new to this but, I was thinking there would be a way in the VB code to find out.
|
|
|
|
|
Then I'd recommend studying how an HTTP server works. The server cannot initiate a connection to, nor can it interrogate, the client-side browser. Doing so would open up a huge range of security issues.
HTTP is simple. The client connects to the web server, makes a request for a page, the web server generates and returns that page, connection closed. Rinse and Repeat... There is no room in there for the client to tell the server anything the server wants to know about the client.
All that VB.NET code executes on the web server only. None of it executes on the browser side. Unless, of course, you start getting into SilverLight[^]. Even then, the code cannot find out anything about the machine the browser is running on...
|
|
|
|
|
Ok that makes sense,
Thanks for the replies
|
|
|
|
|
Hi Guys,
I have a combobox on a form. As soon as I click on the combobox I am unable to get out of it. The combobox shows me all the data it should, but I am unable to exit the control once selected. I can select any value, and do it any number of times however any attempt to close the form, click on another control in the form, etc fails. The only way out is to stop the debugger. No errors are issued.
I've spent an entire day tryin to find the problem and can't. I'd appreciate any ideas please.
The datasource is a very simple dataset (dsCorrespondenceMethods) containing a single table (CorrespondenceMethods). This table contains only 2 columns - an ID column and a description column. The table just contains a list of methods of corresponding such as "Email", "Fax", "Post", etc. I've put it into a table just to make any future changes simple and not require recoding of the app.
Thanks in advance
Mark
|
|
|
|
|