|
What is "this" ?
The this keyword refers to the current instance of the class.
My problem is how to reference the form from within a usercontrole placed on the form.
for example tabcontrol.SelectedIndex = 1; would not be able to escape the usercontrole subsequently it would not work because the tabcontrole is placed on the form not the usercontrole
Hope this makes my prob clearer !
Thanks once again for your time
|
|
|
|
|
john34 wrote: My problem is how to reference the form from within a usercontrole placed on the form.
Use the FindForm method.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
this wont let me at the tabcontrol.selectedindex or any of the public methods on the form
Thanks again though
|
|
|
|
|
Hi all
Thanks Lots for all your help
the bellow code allows me to get to the public methods of the parent form.
I am well chuffed !!!!!!!
Form myForm = FindForm();<br />
if (myForm.Name == "Frmtest")<br />
{<br />
Frmtest test = (Frmtest) myForm;<br />
test.test();<br />
}
Thanks so so much
John
|
|
|
|
|
I created a Custom Control that have a Label control. When i add this control in my aspx page, by default all the property value comes from the asp.net. But i wish to take only few property such as Borderstyle at design time,Font (with style) at design time, Background at design and run time and
FontColor at design and run time only. Please help me ............. to solve this problem.
I am using asp.net 2.0 with c#.
Thanks in Advance
Shail Nigam
-- modified at 9:16 Monday 7th August, 2006
Thanks in Advance
Shail Nigam
|
|
|
|
|
Wrong forum. Go to ASP.NET forum.
|
|
|
|
|
I think it is only possible to do the reverse of what you want. i.e. You can make properties available at design and run time, or at run time only.
If i have mis-understood, u can use the browsable tag above the properties that you dont want to be able to see at design time.
e.g.
[Browsable(false)]
public string data
{
get { ect }
set { ect }
}
|
|
|
|
|
thanks for help, but my main problem is that all the default properties are come itself . How can i stop it?
|
|
|
|
|
Hi,
I have spent all day on this and can't find the problem. Here's some code for a combobox that just won't show the name associated with the value passed to it:
[code]
this.comboBoxDefaultTitle.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.newMemDefaultsBindingSource, "TitleNumber", true));
this.comboBoxDefaultTitle.DataSource = this.titlesBindingSource;
this.comboBoxDefaultTitle.DisplayMember = "TitleDesc";
this.comboBoxDefaultTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBoxDefaultTitle.FormattingEnabled = true;
this.comboBoxDefaultTitle.Location = new System.Drawing.Point(50, 57);
this.comboBoxDefaultTitle.Name = "comboBoxDefaultTitle";
this.comboBoxDefaultTitle.Size = new System.Drawing.Size(151, 21);
this.comboBoxDefaultTitle.TabIndex = 1;
this.comboBoxDefaultTitle.ValueMember = "TitleNumber";
[/code]
I have done this before in the same project (different form and lookups) and they work fine. The above, plus two others on the same form and with similar tasks don't.
I've cross checked the relationships and compared them with the combobox that works and I just can't find what I've done wrong.
I've checked the msdn at http://msdn2.microsoft.com/en-us/library/3h6ac01k(d=ide).aspx and swear I've followed each step to the letter.
Can anyone please give me some suggestions as to where else I need to check to get this working.
Thanks,
Glen Harvy
|
|
|
|
|
Glen Harvy wrote: Can anyone please give me some suggestions as to where else I need to check to get this working.
After considerable searching on the internet I came accross someone with a similar (but not identical) problem that was resolved by someone pointing out that if a specified row in a datatable doesn't exist then the values shown to the user are those for the first row in the datatable.
What that means is that the datatable that is being looked up must be filled prior to the datatable that is being instantiated.
The wording above may not be right but the solution was to fill the newMemberDefaultsBindingSource AFTER the other binding sources had been filled.
Makes sense actually
Glen Harvy
|
|
|
|
|
Im appling a texture to a mesh, i was wondering how would i go about making it place slightly off to the right of where it currently is?
im using managed directx if that helps
|
|
|
|
|
Hello Friends,
Can we check version of installed messanger on the machine.
If possible how to do that. I am currently using COM library of
Messanger. And i have found "MessengerAPI.MMESSENGERPROPERTY"
But i am not understanding how to use that one.
Thanks In Advance.
Rahul Kulkarni
|
|
|
|
|
You can use also FileVersionInfo, see this example, just replace notepad with you messenger:
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(@"C:\WINNT\NOTEPAD.EXE");
string s = "File: " + myFileVersionInfo.FileDescription + '\n' +
"Version number: " + myFileVersionInfo.FileVersion;
Console.WriteLine(s);
|
|
|
|
|
Thanks it works fine.
Rahul Kulkarni
|
|
|
|
|
Hi I am rather new to C#, and I am starting a small windows application project for fun. I was wondering if it its possible to create a menu control with some items(eg. File, Edit) via a configuration file instead of using the designer view mode? How would i go about this?
I'm also wondering if it's possible to just create the menu strip control and items via designer mode, then edit the designer mode code to take in values through a config file?
Thanks
|
|
|
|
|
You can always add MenuItems to a menu.
Something like this
foreach(XmlNode node in MEnuXML.SelectNodes(menu) )
{
MainMenu.AddItem( new MenuItem(node.value);
}
-- modified at 8:34 Monday 7th August, 2006
only two letters away from being an asset
|
|
|
|
|
I think you would have to read the data in from the config file and create the menu items dynamically.
You could do this by creating an xml file for the config, then reading that in and creating the items to the list.
e.g.
// Read config file and serialize (sorry, dont have this bit 2 hand)
foreach(MenuData data in configFile)
{
MenuItem item = new MenuItem();
item.Text = data.Text;
mainMenu.MenuItems.Add(item);
}
|
|
|
|
|
Can anybody please tell me how the usage of RedirectBinding element can be utilised in App.config file. I want to redirect to newer version same assembly in GAC using App.config file, without recompiling the client application.
Thanks
kumar
|
|
|
|
|
Have a look at <a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconassemblyversionredirection.asp" rel="nofollow">this</a>[<a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconassemblyversionredirection.asp" target = "_blank" rel="nofollow">^</a>] MSDN page. According to the article, the usage is
<pre>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="myAssembly"
publicKeyToken="32ab4ba45e0a69a1"
culture="en-us" />
<!-- Assembly versions can be redirected in application, publisher policy, or machine configuration files. -->
<bindingRedirect oldVersion="1.0.0.0"
newVersion="2.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</pre>
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
Thanks senthil, but thats not working fine. My scenario is , I created two projects and refering one in another. I installed two versions of same assembly in GAC (a.dll 1.0 and 1.1). Now the reference assembly in project is a.dll 1.0. I added app.config file and added the redirection elements to redirect from 1.0 to 1.1
I executed the exe from bin folder where config file is also there. But the newer version assembly is not getting refernced at runtime, the same old one which i refered to project at design time is getting refered.
Any solution?
kumar
|
|
|
|
|
Use Itemtemplate columns. Columns that are editable user textbox, columns that are not editable user labels. When you are using item templates, itemdatabound even is mandatory, i am talking about web programming.
Ram
|
|
|
|
|
Hai!
I was asked by one of my colleagues the following question. "Can we associate a single codebehind file with two aspx pages?"
If anyone knew the answer please let me know.
Regards
Sirisha.P
|
|
|
|
|
Never tried this but it should possible by specifying the same inherits and codefile attributes in both aspx pages.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thank you. I have tried that and got the program executed.
Regards
Sirisha.P
|
|
|
|
|
Hello everybody,
I do have a question about reading image data from avi-files using C#.
I have to do some image processing on the image data. Thus, I need the image data itself and not just a Media Player. I already found some code "C# Wrapper" that uses the avifil32.dll that works quite well. However, the .dll seems to be limited to quite a few numbers of avi-codecs. The dll often fails.
I found the "DirectShow Media Player in C#" that works well. It reads in all kinds of avi-codecs using the QuartzTypeLib.dll. However, I do not understand how I reach the image-data itself. It seems to be capsuled within the dll. Even there is the IBasicVideo2.GetCurrentImage-Function I don't know how to use it.
Does anyone know, how I can reach the RGB-values of avi-files that are created by different codecs?
Maybe anyone has an idea?
Joerg
|
|
|
|