|
Just create a new user control in the wizard, and then add things as you need them. Read up on the events that are fired, and think about what you need to do to get to where you want.
You can also derive from an existing control.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ahh this question might sound a bit too naive but where does that wizard come from that ur talking abt
Christian Graus wrote: Just create a new user control in the wizard
|
|
|
|
|
hi every one,
well I'm having table called users(UserName varchar(15) PK, Password varbinary(256))
plz tell me how to insert data in thi s password field.
There is one way to use a query in the code
like
"insert into users values ('"+UserName+"', Convert(varbinary, '"+pass+"'))";
but I wanted to use the insert function in the table adapter u know. and it requires this passwrd to be byte[]
so how do u convert a string to byte[]
Rocky
|
|
|
|
|
System.Text.Encoding.Unicode.GetBytes ( "Hello world" )
|
|
|
|
|
|
Hello everyone!
Okay. I have a game, and it has weapons. I have code like this:
<code>
abstract class Weapon
{
int power;
}
class W_Handgun : Weapon
{
public W_Handgun()
{
power = 40;
}
}
Well, there will be many different types of weapons. So I'd like to save all of the different types in an XML file instead of hard-coding them.
My question is, how do I do that? I know how to read XML files, but how do I convert something like <Handgun><Power>40</Power></Handgun> to the above mentioned class? I'm lost. (And excuse the smiley.)
Thanks in advance!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Look into XML serialization.
|
|
|
|
|
Oh, so that's how it's done. I won't use this method because it's an online game, and it'll be easy for people to hack it. But thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
At least I hope you won't die at 28
|
|
|
|
|
Trust me, I do too.
Windows Calculator told me I will die at 28.
|
|
|
|
|
to store user preference in our application we have an 'hand written' XML file. (as opposed to XmlSerializer written one, which crash sometimes, on some user's computer, for some unknown reason.. but I'm digressing)
In this XML file I store object value, which I convert to string (when writting) and from string (when reading) with a couple of simple function which (should) do a reversible conversion (using TypeConverter) (functions below).
Unfortunately, for some Enum, (namely System.Windows.Forms.Keys) I got a culture dependent string, even though I specify CultureInfo.InvariantCulture as an argument in my ConvertXXX method with the TypeConverter. Even using 'new CultureInfo("en")' do not fix this behavior.
Any tip on how to fix these function (below) so they provide a truly culture independent reversible object=>string=>object mechanism?
===================================================
public static bool TryGetStringValue<T>(object val, out string ret)
{
if (val is string)
{
ret = (string)val;
return true;
}
TypeConverter tc = TypeDescriptor.GetConverter(typeof(T));
if (tc == null)
{
ret = val.ToString();
return false;
}
try
{
ret = tc.ConvertToString(null, CultureInfo.InvariantCulture, val);
return true;
}
catch (ArgumentException) { }
catch (NotSupportedException) { }
ret = val.ToString();
return false;
}
public static bool TryGetTValue<T>(object val, out T tval)
{
if (val is T)
{
tval = (T)val;
return true;
}
TypeConverter tc = TypeDescriptor.GetConverter(typeof(T));
if (tc == null)
{
tval = default(T);
return false;
}
if (!tc.IsValid(val))
{
tval = default(T);
return false;
}
try
{
tval = (T)tc.ConvertFrom(null, CultureInfo.InvariantCulture, val);
return true;
}
catch (ArgumentException) { }
catch (NotSupportedException) { }
tval = default(T);
return false;
}
===================================================
|
|
|
|
|
Doing this breaks databinding of controls
<br />
bindingSourceOnWhichControlsAreBound = bindingSourceWithData;<br />
similary like
<br />
dataSetOnWhichControlsAreBound = dataSetWithData;<br />
However when using DataSet you can do:
<br />
dataSetOnWhichControlsAreBound.Clear;<br />
dataSetOnWhichControlsAreBound.Merge(dataSetWithData);<br />
Is there something similar for bindingSource?
Tnx
|
|
|
|
|
I have a webservice already written and working.. I was able to pull the wsdl from the .asmx page, but I need to generate an XSD. Is there a way to generate the XSD from wither the wsdl or the existing service code? I'm spent the last hour searching the web and came up w/nothing.
Thanks in advance
|
|
|
|
|
Why do you want to generate XSD from WSDL ?
There are many free XSD generators available on net. Just google for it.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hello
I want to create a form like that you can see in project properties page (Right Click on project name and select properties) in visual studio.net, Is that TabControl or just some buttons with custome effects.
Tank you
|
|
|
|
|
It's a custom control, as is much of VS.NET.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
If u want to get the application just which looks like vs.net then you can try CAB/SCSF from microsoft along with third party controls. and if u r looking for only some design consideration like tabbing, thn i think third party tools will help u in designing in that fashion. One of the third party tool i have used is Infagistics. For tabbing, docking and hide positions(as it is in vs.net) is provided by dockmanager control in Infragistics. There are many third party tools, which u can try as it comes with trial versions.
|
|
|
|
|
Tank you freinds
Can you give me a site url about this third party control you mentioned ?
Regards
|
|
|
|
|
www.infragistics.com download the trial version.
|
|
|
|
|
I am writing a service and I want to load an assembly from within my bin directory where I'm executing from. Assembly.GetExecutingAssembly() returns null. Environment.CurrentDirectory points at the system32 folder. So how the heck to I get where I was loaded from???
Any help would be appreciated.
Michael
|
|
|
|
|
System.Windows.Forms.Application.ExecutablePath
|
|
|
|
|
This returns null in a windows service.
|
|
|
|
|
From: theRealCondor
If you bothered to read my post instead of jumping in and providing something worthless then you would save from making yourself look like an idiot.
Well how about
System.Windows.Forms.Application.StartupPath
I just found that I use that in one of my services.
-- modified at 19:45 Wednesday 2nd May, 2007
|
|
|
|
|
I haven't found that to be the case.
Two other methods that may work:
System.Reflection.Assembly.GetCallingAssembly().Location
System.Reflection.Assembly.GetExecutingAssembly().Location
|
|
|
|
|
FYI - I was half asleep while doing all this posting on the service. You kept asking how the ExecutablePath could return null and you are correct it did not return null. Per my original post that is the one call that returned a value: C:\Windows\System32
Obviously that was not useable. The reason I do not get the base folder is because I'm being called by the operating system in my OnStart and OnClose events. The AppDomain finally gave me the correct path since that tracks the base path of the current application domain regardless of the calling application domain.
I believe you asked about why do it in the events in one of your questions. I am managing WCF ServerHost entities which have to be started at OnStart and closed correctly at OnClose or OnShutdown. So I hope this clears all of your confusion regarding what I was experiencing vs. what you experienced.
|
|
|
|