|
In a normal world, others decide on a name, not the person or object itself. Because it is others who will use the name to refer to the person or object.
|
|
|
|
|
Now that is called an "Expert" Comment.
|
|
|
|
|
TechBearSeattle wrote: The Name property returns an empty string, presumably because it has not been initialized yet. That's my question
Correct. The control may not have a name immediately upon creation, or even at certain times in it's life. So, in your drawing code, you have to check for this and act appropriately.
BTW: The Name property is not mandatory. You can have instances of the control without a Name value being set at all. An example of such would be a dynamically created control instance in your consumers code.
|
|
|
|
|
Visual Studio Designer uses Control.Name to store the name of the variable holding the reference to said Control; it does so for all kinds of Controls and Control derivatives.
If you use another way of adding a Control, its Name will default to an empty string; if you want it to have a name, you should take care of that right after the instantiation.
|
|
|
|
|
Maybe if I described what I'm doing, my question will make more sense
I am working on a custom tab control that implements custom tab pages. These are both derived from Control and are just as much a learning trial as an effort to make something useful. As far as possible, I would like to duplicate the effect of Microsoft's standard tab control. When I drop TabControl on a form, I get two tabs, TabPage1 and TabPage2. A second TabControl gives TabPage3 and TabPage4.
In the constructor of NewTabControl , I am trying to do this:
Dim P1 As New NewTabPage
Dim P2 As New NewTabPage
pTabPages = New NewTabPageCollection(P1, P2)
P1.Text = P1.Name
P2.Text = P2.Name
This is adding the two pages. What I want is for the tab captions to show the page names. However, the Name properties hold empty strings. I would like to populate those values.
On a possibly related note, I notice in the Form.Designer code that the MS TabControl generates the code for the MS TabPage s explicitly along with the code for the TabControl , while the generated code for NewTabControl defines only NewTabControl1. Is my solution to generate designer code for the NewTabPage objects and, if so, how?
|
|
|
|
|
Hi,
The few lines below is basically what I'm trying to do:
Dim sPerm As New SocketPermission(NetworkAccess.Connect, TransportType.Tcp, "207.46.232.182", 80)
sPerm.PermitOnly()
Dim ePoint As New IPEndPoint(IPAddress.Parse("207.46.232.182"), 80)
Dim s As New Socket(ePoint.Address.AddressFamily, SocketType.Stream, ProtocolType.Tcp)
s.Connect(ePoint)
MsgBox("Connected:" + s.Connected.ToString)
s.Close()
Can anyone tell me why is the System.Net.SocketPermission implementation so miserable? I could only get sPerm.Deny() to work, but then it won't work on wild card IP addresses!!
|
|
|
|
|
Hey,
I'm trying to create a Windows Service in C++ Dot Net. I've got Visual Studio 2008 Pro Edition on Server 2008.
I'm trying to create a Windows Service using this procedure:
http://msdn.microsoft.com/en-us/libr...8VS.80%29.aspx
However when I get to the Step 2.3 the Project Output Dialog is blank
(as seen in this screen shot http://imagebin.ca/view/wtjiwJ7z.html )
I feel like I need to get the output right for this application to work. What should I do?
I admit that I'm a noob to Visual Studio
x-posted on Tech Republic and Tech Support Forum
|
|
|
|
|
Hi,
you didn't add the project of the windows service you've created to the solution. Do this by clicking the solution icon in the solution explorer and select "Add Existing project". Thi should fill the combobox.
Regards
Sebastian
|
|
|
|
|
Sebastian,
Wow I think this will work!! Thanks!!
|
|
|
|
|
|
No one is going to read this unformatted garbage. Fix the formatting and only post what is necessary, not all of the code in your app. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Since you don't like the way it's posted fix your dam editor I used the code block to insert.
bye will not re post will ask on MSBN
|
|
|
|
|
You do know that it's not his editor don't you?"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Yes I know its not his editor but he told me several thing such as to not post as much code well ok I won't post any Because without the code that I am using how can he tell where the problem is. I did not post anymore code than I thought was necessary all it contained was the datagridview and the print set up routine. If he did not need that then he should be able to answer the question without the code at all. But I was not thinking of him when I posted it. I was thinking of the beginners that try to follow what is going on, with out the code their lost.
Besides what portion am I supposed to post. The whole thing is interlaced with setup calls. This is a problem that is caused by logic not caused by something that is just not getting the data. To troubleshoot logic you have to have the code.
|
|
|
|
|
|
MSDN Hit wrong key.
But the editor still caused the problem. Since it did not display the code the way it is in Visual Studio. I will not spend two or three days trying to get it to display the code to your liking. I wrapped the code in the pre tags. I don't have the time to try to figure out whats wrong with this editor. This
|
|
|
|
|
I am currently moving away from using the registry.
Therefore I am using My.Settings , and of course, the user-scoped settings are easy to use.
Before moving on to my question, though, I would like to comment on some undesirable user-scoped setting behaviour: User-scoped settings seem to be disappearing when my customer updates my product to a newer version. (This doesn't happen when using the registry to store settings.) It would be nice to find a way to persist those across version changes.
Anyway, I have at least one Application-scoped setting that I want to generate at runtime - it's a guid to uniquely identify the current computer, and I want to store the setting somewhere so that if more than one user uses this machine, I still know which machine has been involved in whatever user activity. I use it to track that "Joe", using "the computer over by the water cooler" changed the phone number for some customer.
Right now, I use HKLM to store the guid. Any suggestions about how to accomplish that, and besides - what's up with that!?? Doesn't everyone have application scoped settings that they want to change? I can't ask my customer to go and manually edit app.config !!____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
My suggestion would be that this type of audit data should be stored in a database, not in user settings.
The settings are most likely being overwritten because during an update the config is being replaced with the default. You would need to handle this situation during the update and copy the settings. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yeah, I do actually store most settings in the database. The guid I referred to has to reside on the machine so I can xref it with the database row that contains the plain english description of the computer, e.g. "the computer over by the water cooler".
I suppose I could have the installer generate the guid and put it in the config file as a permanent entry at install time, but I haven't looked into how to do that. Is anyone doing that?
Re: user settings magically toasted on update:
I agree about copying the settings during the update... but that's what I was hoping to avoid... seems like work. 8^D
To do that, I guess I'd have to figure out a temporary store for them... xml I suppose, but haven't looked into the best way to write my own xml files yet. Any suggestions?____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
I wouldn't worry about creating a special GUID to identify the machine, use the MAC address. It will uniquely identify the machine and is less prone to manipulation than an entry ina config file. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: use the MAC address
Excellent suggestion, that's exactly what I will do.
Now what's the laziest way to write a quick xml file? The configuration object? Haven't had a go on that sort of thing yet, always use text files - old school.____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
LINQ to XML[^] Look at the section called "The New Way" I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks, Mark
Actually I was able to harvest what I needed from "the old way" because I don't need to reference .Net 3.5 to do it. So far none of my components use that. I've decided to store all my settings, do the update, and restore the settings.
BTW, I noticed a path in My.Settings:
My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData
I wonder if that might be a handy place to throw temp stuff like this.____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
Hi,
assuming that is the same as System.Environment.SpecialFolder.CommonApplicationData , normal users won't have write access on modern Windows versions, unless you take special care; see here[^].
|
|
|
|
|
Thanks, Luc
Ou merci!____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|