|
Dear friends,
How can i add flash movie to my MDI form by using C#.
|
|
|
|
|
Add a form, place a web browser control on the form, set browser.Dock to DockStyle.Fill, and navigate the browser control to your flash movie.
<br />
Object objNull = null;<br />
axBrowser.Navigate(papplicationPath + "\\movie.swf", ref objNull, ref objNull, ref objNull, ref objNull);<br />
|
|
|
|
|
Issue: how do you get access to the parent, if deleting a child row from a dataset and dataset.GetChanges has been made?
If you make an update, insert and a delete everything works fine, but not when you just delete a child row.
I have 2 tables in a TypedDataSet called ArticleTDS, the parent table is Article and the child table is ArticleCountry.
The ArticleTDS is filled in the DataAccessLayer and passed through to the BusinessLayer here we make a check that Article is only one and passes the articleTDS to the Façade. The façade creates a Client Business Object wrapping the dataset and displays it to the Client ASPX page.
If the user now only deletes a row of ArticleCountries we set the ArticleCountryRow.Deleted.
The client now wants to save the entire article to the server. The ArticleEntity makes the following
myFacade.SaveArticleChanges((ArticleTDS) this.articleTds.GetChanges());
The façade passes the tds through to business like so:
articleServTx.SaveArticleChanges(articleTds);
In the transactional article business we want to make validation on the entire article before saving to the datalayer like the following:
// Check for null parameters
if (articleTds == null){throw new ArgumentNullException("articleTds", "The articleTds parameter in SaveArticle must not be null");}
// Filter out the changed rows (normally done by the caller, but just in case..)
ArticleTDS filteredArticleTDS = (ArticleTDS) articleTds.GetChanges();
// Get the number of articles in the dataset.
int numberOfArticlesInDataSet = filteredArticleTDS.Article.Rows.Count;
// Check that the article dataset contains exactly one article.
// The error will occur here, because we don’t get the article table when deleting a row in the child table.
if (numberOfArticlesInDataSet == 0)
{
throw new ApplicationException("ArticleTds contains no article.");
}
if (numberOfArticlesInDataSet > 1)
{
throw new ApplicationException(String.Format("ArticleDataSet contains more than one article. It contains {0} articles.",numberOfArticlesInDataSet));
}
How can you go around this problem with deleting a child row and the client has made GetChanges?
Maqster
|
|
|
|
|
How can I make a Form that the user can't interact with, but still shows as though it is enabled?
If it is posible the form is allowed to be resized, min, max ... but no keys or clicks from the user should go to any controls inside the form.
Does anyone know how to do this?
|
|
|
|
|
have you tried object.Enabled=false; ?
that greys out everything disallowing the user to interact with the control
|
|
|
|
|
Thats the whole point, I want to do what Enabled=false does, but without the graying out. Also the Forms move, resize min, max function should be enabled with the right cursor.
|
|
|
|
|
Hi friends
I have a multiselect listbox
and i am sending selected data to my sql
but when user want to retrive the data how can i select multiple rows.
suppose i have a listbox and its rows are
abc
xyz
pqr
user select 'abc' and 'pqr' and save the data
after some time user want to see that details
no i have data in database 'abc' & 'pqr'
but how can i set multiple data in list box
on page load i have to select 'abc' and 'pqr'
how this i possible
Thanks
|
|
|
|
|
To set multiple selections in a list control programmatically
Loop through the control's Items collection and set the Selected property of every individual item.
Note You can only select multiple items if the control's SelectionMode property is set to Multiple.
The following example shows how you can set selections in a multi-selection ListBox control called ListBox1. The code selects every other item.
' Visual Basic
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim li As ListItem
For Each li In ListBox1.Items
i += 1
If (i Mod 2 = 0) Then
li.Selected = True
End If
Next
End Sub
// C#
public void Button1_Click(object sender, System.EventArgs e)
{
// Counter
int i = 0;
foreach(ListItem li in ListBox1.Items)
{
if( (i%2) == 0)
{
li.Selected = true;
}
i += 1;
}
}
I hope this will solve ur query.
I do not know any other way of doing it. If u find one let me know
ref: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskdeterminingselectioninlistbox.asp
Cheers,
Mohit
|
|
|
|
|
How to create MSN Messenger type status bar popup message box in C# or VB.NET?
Thanks in advance
|
|
|
|
|
dashingdracula wrote:
How to create MSN Messenger type status bar popup message box in C# or VB.NET?
Your answer is already here in CP. Be sure to always search first:
Try Here![^]
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
hi!!
my new project involes accessing a remote SQL server using ADO.net and displaying the information in Microsoft Excel.but the code must not be accessible thru access.
it'll be great if u could help with an idea..
thanx...
shweta.
|
|
|
|
|
//vc++:
FormatMyDisk(char * TransData, char* VolumeName)
{
char *FormatW2K = "CMD.EXE";
char FormatW2KParam[100] = {0};
sprintf(FormatW2KParam, "/C \"format.com %c:/q/x/FS:FAT/V:%s\"",*TransData,VolumeName);
ShellExecute(NULL,"open", FormatW2K, FormatW2KParam, NULL, SW_SHOW);
}
what does the identical C# code look like?
|
|
|
|
|
Take a look at the Process and ProcessStartInfo classes which provide everything needed to replace the ShellExecute.
The rest is some simple string concatenation you should be able to do yourself.
www.troschuetz.de
|
|
|
|
|
My question is that I have to print a string from server side C#
if(e.CommandName =="Print")
{
string parsedreceipt = null;
parsedreceipt = DecodeReceipt (e.Item.Cells[3].Text);
===> here I need to print to the printer and pass the string
parsedreceipt which is the information that I want to print.
}
I need your help badly on this one.
Here is my function:
public void ReceiptsDataGrid_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
ListItemType oType =
((ListItemType)e.Item.ItemType);
if(oType == ListItemType.Item || oType ==
ListItemType.AlternatingItem)
{
e.Item.Attributes.Add("onmouseover",
"this.style.backgroundColor='lightblue'");
e.Item.Attributes.Add("onmouseout",
"this.style.backgroundColor='Beige'");
}
if(e.CommandName =="View")
{
string parsedreceipt = null;
parsedreceipt = DecodeReceipt
(e.Item.Cells[3].Text);
StringBuilder strAlert = new
StringBuilder();
strAlert.Append("<script
language=javascript> alert('");
strAlert.Append("Receipt:" + parsedreceipt +
"\\n");
strAlert.Append("');");
this.RegisterStartupScript("startup",strAlert.ToString());
}
if(e.CommandName =="Print")
{
string parsedreceipt = null;
parsedreceipt = DecodeReceipt
(e.Item.Cells[3].Text);
}
}
Any help would be appreciated.
|
|
|
|
|
I have a base class, that defines an Enum.
I have one or more sub classes that redefine that Enum (using the new keyword).
I am trying to write code in the base class to iterate through the enum, as defined by the subclass that is calling the code.
Any ideas how? I'm trying to work my way through Reflection, and I can get all of the properties and methods, but cant get any info about any Enums that might be there.
Thanks
--
Dave
|
|
|
|
|
In case anyone cares:
Type[] tNested = this.GetType().GetNestedTypes(System.Reflection.BindingFlags.NonPublic);
object rt = null;
foreach (Type t in tNested)
{
rt = Activator.CreateInstance(t);
break;
}
--
Dave
|
|
|
|
|
Hi everybody.
I'm trying to create a web application with C#.net or C++ like the (windows updates from Microsoft) to let the customer of our company download automatically our executables files from the web and also let the web app automatically the install those files on their computers.
If somebody has any idea of how to do it or any source code about it, I’d appreciate.
Thanks
Ali Hidalgo
|
|
|
|
|
Well Windows Update uses a service called Background Intelligence Transfer Service (BITS). You can use this to download files or updates, then you'll have to write some code to update your application. Of course you dont have to use BITS, you can write your own downloader or use WebClient.DownloadData/File if you dont mind it holding up your app...
Dan
|
|
|
|
|
Hi gurus,
With WMI and C#, how can I detect if a network adaptor is a virtual or physical?
Thanks.
Best regards.
There is no spoon.
|
|
|
|
|
You can't check for a flag like that, but you can use the available information to POSSIBLY figure it out. Most virtual adapaters will not have an AdapterType in their Win32_NetworkAdapter class. Physical adpaters usually will. For example, you could check each adapter for an "Ethernet 802.3" Adapter Type.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
It seems that I have the correct information when I do the following SQL statement on WMI:
SELECT Description, IPAddress FROM Win32_NetworkAdapterConfiguration WHERE ((DHCPEnabled = 'TRUE') AND (IPEnabled = 'TRUE'))
But I don't know if it will work on manually configured ethernet adapters.
When I do a request on Win32_NetworkAdapter class with the AdapterTypeID set to 0 (Ethernet 802.3) I get back the 1394 adapters and a lot of other adatper types while I need only to retrieve physical network Ethernet adapters (no virtual ones).
There is no spoon.
|
|
|
|
|
No, it won't. Even VPN adapters can have those properties set to True. Also, not all properties of the class are set by the drivers manufacturers. AdapterTypeID, since it is available in XP and above only, might not be set. It, also, does not support a NULL value, so if it is not set properly, or at all, it defaults to 0. Use the string parameter AdapterType instead.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Gurus,
What is the equivalent of the MFC's combo member SetItemData and GetItemData in C# for combo boxes?
Thanks.
Best regards.
There is no spoon.
|
|
|
|
|
Hi - not a guru here but what I use to populate a combobox is: combobox.Items.Add([value]);
Not sure what you need to use to replace GetItemData I use an equivilency test eg: if([value].Equals(combobox.Text))...ect but there maybe a better way.
Hope this helped
|
|
|
|
|
Hi,
thanks.
I have found how to add personal data to combo box items
thanks anyway
There is no spoon.
|
|
|
|