Search Results

Search found 4334 results on 174 pages for 'sender'.

Page 96/174 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • how to set(get) cookie value in ext.net

    - by user591587
    scene: when I click item in ext:ComboBox and want to set the item selected value to cookie variable. Finally, after I click ext:Button, the ext:Label get cookie value and display it. But I get a error :Ext.Ajax Communication Failure , any help will be appreciated. aspx: <ext:ComboBox ID="ComboBox1" runat="server" StoreID="Store1" Width="100" Editable="false" DisplayField="name" ValueField="value" Mode="Local" TriggerAction="All`enter code here`" EmptyText="Select a locale..."> ..... aspx.cs protected void lngIndexChanged(object sender, DirectEventArgs e) { //Sets the cookie that is to be used by Global.asax HttpCookie cookie = new HttpCookie("CultureInfo"); cookie.Value = ComboBox1.SelectedItem.Value ; Response.Cookies.Add(cookie); Label1.Text = cookie.Value; //Set the culture and reload for immediate effect. //Future effects are handled by Global.asax Thread.CurrentThread.CurrentCulture = new CultureInfo(ComboBox1.SelectedItem.Value); Thread.CurrentThread.CurrentUICulture = new CultureInfo(ComboBox1.SelectedItem.Value); }

    Read the article

  • set different volumes inside app

    - by blacksheep
    i'd lioke to set the volume inside the touchesBegan action on half the volume of the IBAction. (void) awakeFromNib { [super awakeFromNib]; engine = [[Finch alloc] init]; E = [[RevolverSound alloc] initWithFile:PATH(@"E.wav")rounds:9]; } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:self.view]; if(CGRectContainsPoint(Edrop.frame,location)){ [E play]; } } (IBAction)bass:(id)sender { if(CGRectIntersectsRect(finga.frame,e.frame)){ if(finga.center.y <= e.center.y) [E play]; } } thanx, blacksheep

    Read the article

  • Extraction Event

    - by Anicho
    So I have the following code: public override void Extract(object sender, ExtractionEventArgs e) { if (e.Response.HtmlDocument != null) { var myParam = e.Request.QueryStringParameters.Where(parameter => parameter.Name == QueryName).Select(parameter => parameter.Value).Distinct(); myParam. // add the extracted value to the web performance test context e.WebTest.Context.Add(this.ContextParameterName, myParam.ToString()); e.Success = true; return; } // If the extraction fails, set the error text that the user sees e.Success = false; e.Message = String.Format(CultureInfo.CurrentCulture, "Not Found: {0}", QueryName); } It's returning: System.Linq.Enumerable+<DistinctItem>d_81`1[system.string] I am expecting something along the lines of: 0152-1231-1231-123d My question is how do I extract the querystring's actual value from extractioneventargs. They say it's possible, but I have no idea.

    Read the article

  • When to databind data-bound controls?

    - by sanjuro
    Hi, i have little dilemma, i often use data-bound controls such as Gridview in conjunction with ObjectDataSource. But i have two possible options when can i bind data to Gridview. The first is that i set datasourceid of gridview in aspx file and databind occurs in a moment before PreRender event occurs or i can set datasource in Page_Load event and databinding occurs immediately, something like this: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { testGridView.DataSource = testObjectDataSource.Select(); testGridView.DataBind(); } } I think that in second approach i have more control above databinding. But how it is in real programming life? Which of the above two options is commonly used? Or is there some third option how can i bind data to data-bound control? Thanks for your opinions from real-life experiences.

    Read the article

  • Why does addSubview load the view asynchronously

    - by moshe
    I have a UIView that I want to load when the user clicks a button. There happens to be some data processing that happens as well after I call addSubview that involves parsing an XML file retrieved from the web. The problem is the view doesn't show up until after the data processing even if addSuview is called first. I think I'm missing something here, can anyone help? Code: I have a "Loading..." view I'm adding as a custom modal (meaning I'm not using the modalViewController). This action is linked to a button in the navigationController. - (IBAction)parseXml:(id)sender { LoadingModalViewController *loadingModal = [[LoadingModalViewController alloc] initWithNibName:@"LoadingModalViewController" bundle:nil]; [navigationController.view addSubview:loadingModal.view]; [xmlParser parse]; }

    Read the article

  • How can I process a form's events in another class / module automatically in VB.NET

    - by CowKingDeluxe
    Here's my code: Public Class Form1 End Class Public Class Form1Handler Inherits Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox("I") End Sub End Class I'm trying to get Form1Handler to process Form1's events automatically. How can I do this? Should I use a module instead? I'm doing this in VB 2010. I don't want to have to make an event handler in Form1 and then pipe it to the other class / module, is there some way to automatically "pipe" the events from form1 to form1handler?

    Read the article

  • passing values to pages

    - by Indranil Mutsuddy
    Hello friends, What i am trying here is to pass values to other pages. When i include the following code private void Button1_Click(object sender, System.EventArgs e) { // Value sent using HttpResponse Response.Redirect("WebForm5.aspx?Name="+txtName.Text); } if (Request.QueryString["Name"]!= null) Response.write( Request.QueryString["Name"]); everything works fine the name gets displayed. Now if use MemberId instead, though i can see the Id in the Url, but while checking for Null in other page, its true. Whats wrong?? Now I tried the same thing using session i.e. Session["MemberId"] = this.TxtEnterMemberId.Text; if (MemberSex.Equals("M")) Response.Redirect("PatientDetailsMale.aspx",false ); Page_load event of the other page if (Session["MemberId"] != null) mid = Session["MemberId"].ToString(); IT Works..Could u guys explain the behaviour please? P.S. Can anyone give a breif in layman words about SessionId and its usage. Thanking you, Indranil

    Read the article

  • Constant Expected "{" before ")" token

    - by Thijs
    I've got a little problem. I am applying some changes to an iOS program i wrote, but I've struck a problem. I constantly get a "Expected '{' before ')' token" warning, but my coding skills aren't good enough to find the problem. A little help would greatly be appreciated. #import "Search.h" #import "RootViewController.h" //button - (IBAction)buttonPressed)sender{ RootViewController *newview = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; [UIView setAnimationTransition:UIViewAnimationTransitionFl ipFromRight forView:self.view cache:YES]; [self.view addSubview:newview.view]; [UIView commitAnimations]; @implementation Search @end

    Read the article

  • Does Adorner breaks MVVM?

    - by Padu Merloti
    I'm developing a WPF app using MVVM. Most of my views have only xaml markup and nothing (except default boilerplate) on code behind. All except one view that I use adorners to "blacken" the screen when I want to make the whole screen disabled. private void Window_Loaded(object sender, RoutedEventArgs e) { //todo: transfer to modelview contentAreaAdorner = AdornerLayer.GetAdornerLayer(contentArea); waitingAdorner = new WaitingAdorner(contentArea); } Is that ok? Or is there a better way to implement this in my viewmodel?

    Read the article

  • How do I let main thread suspend and wait for the System.Timer.Timer running

    - by Kelvin
    Hi I am using System.Timer.Timer I always get NULL after running my programme and it only works if I add this.sleep(6000). Suppose the reason is the main thread ends but the timer hasn't finished ... Here is the class and I call the class from my main form. Class class1 { string finalResult = ""; public string getNumber() { RunTimer(); return finalResult; } pubic void RunTimer () { timer = new System.Timers.Timer(30000); timer.Interval = 1000; timer.Elapsed += new System.Timers.ElapsedEventHandler(cal); timer.Start(); } private void cal(object sender,System.Timers.ElapsedEventArgs e) { finalResult += READFROMCOMPORT; } }

    Read the article

  • SMS Receiving using DOTNET C#

    - by sheery
    Hi dears, I have build an application using C# to send and receive sms, my application works fine for sending sms but when i try to read sms from my mobile through my application i get following error "Error: Phone reports generic communication error or syntax error." can any one help me in this matter, my syntax for reading sms is private void btnReadMessages_Click(object sender, System.EventArgs e) { Cursor.Current = Cursors.WaitCursor; string storage = GetMessageStorage(); try { // Read all SMS messages from the storage DecodedShortMessage[] messages = comm.ReadMessages(PhoneMessageStatus.All, storage); foreach(DecodedShortMessage message in messages) { Output(string.Format("Message status = {0}, Location = {1}/{2}", StatusToString(message.Status), message.Storage, message.Index)); ShowMessage(message.Data); Output(""); } Output(string.Format("{0,9} messages read.", messages.Length.ToString())); Output(""); } catch(Exception ex) { ShowException(ex); } Cursor.Current = Cursors.Default; }

    Read the article

  • E.cancel loop in Visual basic

    - by Ahmed
    I am making an server control application ( simple with some buttons to start/stop the server ) And when the user wants to close the application there will be prompted an confirm box. Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing Dim response As Integer response = MsgBox("Are you sure you want to stop the server", vbYesNo, "Stop Server ?") If response = vbYes Then Shell("cscript ""stop.vbs""", 1) Close() Else e.Cancel = True End If End Sub That is the code I have now. But when I start the application and close it with the X button or with "Close Window" I will be prompted with the question until I click on no, then it will close. It's a loop and it stops when you first click on yes then on no. Can someone help me with solving this ?

    Read the article

  • Navigation Items in Navigation Bar are not appearing?

    - by Sheehan Alam
    I am displaying a UITableViewController inside of a UITabBarController that is being presented modally: -(IBAction)arButtonClicked:(id)sender{ ARViewController* arViewController = [[[ARViewController alloc] initWithNibName:@"ARViewController" bundle:nil]autorelease]; LeaderBoardTableViewController* lbViewController = [[[LeaderBoardTableViewController alloc] initWithNibName:@"LeaderBoardTableViewController" bundle:nil]autorelease]; lbViewController.title = @"Leaderboard"; arTabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil]; arTabBarController.viewControllers = [NSArray arrayWithObjects:arViewController, lbViewController, nil]; arTabBarController.selectedViewController = arViewController; [self presentModalViewController:arTabBarController animated:YES]; } In my viewDidLoad for arViewController method I am setting the navigation items: - (void)viewDidLoad { [super viewDidLoad]; // Uncomment the following line to preserve selection between presentations. self.clearsSelectionOnViewWillAppear = NO; self.title = @"AR"; leaderBoardButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemOrganize target:self action:@selector(leaderBoardButtonClicked:)]; self.navigationItem.rightBarButtonItem = leaderBoardButton; } My navigation bar doesn't appear when it is inside of the UITabBarController, but when I push the view itself I am able to see it. What am I missing?

    Read the article

  • How to programmatically change a data cell of Ms Access using VB.Net?

    - by manuel
    I have a Microsoft Access database file connected to VB.NET. In the database table, I have a 'No.' and a 'Status' column. Then I have a textbox where I can input an integer. I also have a button, which will change the data cell in 'Status' where 'No.' = textbox.Text(), when I click it. Let's say I want the 'Status' cell to be changed to "Low". What codes should I put in the button_Click event handler? Here is the codes I used to retrieve and display the database table. Public Class theForm Dim con As New OleDb.OleDbConnection Dim ds As New DataSet Dim daTitles As OleDb.OleDbDataAdapter Private Sub theForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|\db1.mdb" con.Open() daTitles = New OleDb.OleDbDataAdapter("SELECT * FROM Titles", con) daTitles.Fill(ds, "Titles") DataGridView1.DataSource = ds.Tables("Titles") DataGridView1.AutoResizeColumns() End Sub

    Read the article

  • Delete a Row from a DataGridView given its index

    - by Ruben Trancoso
    My DataGridView is a single line selection and theres a rowEnter Event where I get the line index every time the selected line changes. private void rowEnter(object sender, DataGridViewCellEventArgs e) { currentRowIndex = e.RowIndex; } when I press a delete button I use the same index to delete the row myDataSet.Avaliado.Rows[currentRowIndex].Delete(); avaliadoTableAdapter.Update(myDataSet.Avaliado); it works fine if no column in the DataGridView is sorted, otherwise a get an error. What should be the way to know the row index in the dataset that corresponds to the rowindex from the DataGridView?

    Read the article

  • Merging a custom ContextMenuStrip with the system edit context menu in a DataGridView

    - by Tom
    I have a DataGridView in a VB.NET app that I have limited to cell selection only. The control has two columns, the first is not editable, the second is editable. I have a ContextMenuStrip that provides some additional functionality and I am able to make it appear when an editable cell receives a right click and is not in edit mode. Based on an example in a Microsoft forum, I am able to now show the context menu when an editable cell receives a right click while also in edit mode. That code is as follows: Private Sub DataGridView1_EditingControlShowing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing If TypeOf e.Control Is TextBox Then With DirectCast(e.Control, TextBox) .ContextMenuStrip = ContextMenuStrip1 End With End If End Sub This, however, completely overwrites the system context menu of the editing control. How can I merge my Context Menu Strip (ContextMenuStrip1) with the system context menu? For further information, I am using VS2008, but targeting the .NET 2.0 platform.

    Read the article

  • C#: how to check and display the content of a folder?

    - by user147685
    I'm not sure whether this topics has been disscussed before or not, but I'm not sure the exact word to search for it. What method/class should I use? The program has 3 buttons: 1) for folder browsing, 2) scan for the selected folder content, and 3) open the file. When user browse the selected folder*(1), user click scan button to scan from the first file until the last available files and listed it text box(2)* and from that user can decide whether to open the files or not*(3)*. Here are what have I done so far (no 1 and 3): //For browse. private void browse2() { if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { this.txtDest.Text = folderBrowserDialog1.SelectedPath; } } //For opening folder. private void btnOpen_Click(object sender, EventArgs e) { try { Process.Start(txtDest.Text); } catch { MessageBox.Show("Please select one file/folder"); } }

    Read the article

  • How can I use multiple Datatables on my CrystalReport?

    - by Sergio Tapia
    I have a dataset that connects with three databases. How can I attach my Crystalreport viewer so all three are included? protected void Page_Load(object sender, EventArgs e) { ReportDocument X = new ReportDocument(); DataTable DTable = new DataTable(); DataSet1TableAdapters.TableAdapterManager ????? = new WebApplication1.DataSet1TableAdapters.TableAdapterManager(); DTable = ???????? string ubicacion = Server.MapPath("crystalReport1.rpt"); X.Load(ubicacion); X.SetDataSource(DTable); CrystalReportViewer1.ReportSource = X; }

    Read the article

  • What's the VB.NET equivalent of this C# code for wiring up and declaring an event?

    - by Ben McCormack
    I'm working on a tutorial to build a media player in Silverlight and am trying to wire up an EventHandler to the timer.Tick event of a DispatchTimer object so that the time of the video is synced with a Slider object. The sample code is in C# and I can't for the life of me figure out the proper syntax in VB.NET with RaiseEvent and/or Handles to wire up the event. Below is the relevant C# code. I'll include comments on where I'm getting stuck. private DispatchTimer timer; public Page() { //... timer = new DispatchTimer(); timer.Interval = TimeSpan.FromMilliseconds(50); timer.Tick += new EventHandler(timer_Tick); // <== I get stuck here b/c // I can't do "timer.Tick += ..." in VB.NET } void timer_Tick(object sender, EventArgs e) { if (VideoElement.NaturalDuration.TimeSpan.TotalSeconds > 0) { sliderScrubber.Value = VideoElement.Position.TotalSeconds / VideoElement.NaturalDuration.TimeSpan.TotalSeconds; } }

    Read the article

  • Find directory on different server C#

    - by rainhider
    I have a website on Server A and it needs to find a directory on Server B. On my aspx page, I have: <mb:FileSystemDataSource ID="fileSystemDataSource" runat="server" RootPath="\\servername\Folder\Subfolder" FoldersOnly="true" /> mb is assembly name alias. On my aspx.cs page, I have: protected void Page_Load(object sender, EventArgs e) { DataTable gridviewSource = DisplayFilesInGridView(); DataRow gridviewRow; //sets the server path so it does not default to current server string ServerPath = System.IO.Path.Combine( "//", this.fileSystemDataSource.RootPath); //Get All Folders Or Directories and add in table DirectoryInfo directory = new DirectoryInfo(Server.MapPath(ServerPath)); DirectoryInfo[] subDirectories = directory.GetDirectories(); } Well, it throws an error on the Server.MapPath because it cannot find the server. I am connected to the network. I looked at IIS, and I am pretty sure that is not the problem. If so, I would really need specifics. Any help would be appreciated.

    Read the article

  • Recommended Python publish/subscribe/dispatch module ?

    - by Eli Bendersky
    From PyPubSub: Pypubsub provides a simple way for your Python application to decouple its components: parts of your application can publish messages (with or without data) and other parts can subscribe/receive them. This allows message "senders" and message "listeners" to be unaware of each other: one doesn't need to import the other a sender doesn't need to know "who" gets the messages, what the listeners will do with the data, or even if any listener will get the message data. similarly, listeners don't need to worry about where messages come from. This is a great tool for implementing a Model-View-Controller architecture or any similar architecture that promotes decoupling of its components. There seem to be quite a few Python modules for publishing/subscribing floating around the web, from PyPubSub, to PyDispatcher to simple "home-cooked" classes. Can you recommend a module that works well in most cases ? Which modules have you had positive experience with ? Negative ? Thanks in advance

    Read the article

  • iPhone: Crash When Deleting UITableView Rows

    - by Ajeet Kumar Yadav
    Hi, I am new in iPhone development. I am developing an application that fetches a value from a database and displays it in a table view. I want to delete table rows one by one but the rows do not delete and the application crashes. Here is my row deletion code: - (void)tableView:(UITableView *)tv commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if(editingStyle == UITableViewCellEditingStyleDelete) { SanjeevKapoorAppDelegate *appDelegate =(SanjeevKapoorAppDelegate *)[[UIApplication sharedApplication] delegate]; list *animal =[appDelegate.list1 objectAtIndex:indexPath.row]; [appDelegate deleteCoffee]; [self.tableView reloadData]; //Delete the object from the table. [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; } I also delete all rows with this action: -(IBAction)deletebtn:(id)sender{ SanjeevKapoorAppDelegate *appDelegate =(SanjeevKapoorAppDelegate *)[[UIApplication sharedApplication] delegate]; [appDelegate deleteCoffee]; [self.tableView reloadData]; } How do I properly implement delete in an UITableView?

    Read the article

  • Using (void)awakeFromNib

    - by MN
    I am trying to run an action when the application starts. The action checkAtStart is supposed to display an alert if there is no text in field1 and hide startView if there is text in field1. checkAtStart works fine if assigned to a button, but when I try to run it using (void)awakeFromNib, the alert will display no matter what and startView will never hide. Its probably something really simple that I'm forgetting. Any help is appreciated! Here is my code: - (void)awakeFromNib { [self checkAtStart:self]; } - (IBAction)checkAtStart:(id)sender { if (field1.text == nil || [field1.text isEqualToString:@""]) { NSString *msg = nil; msg = nil; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Test Message" message:@"Test Message" delegate:self cancelButtonTitle:@"Close" otherButtonTitles: nil]; [alert show]; [alert release]; [msg release]; } else { startView.hidden = YES; } }

    Read the article

  • How to pass an event to a method and then subscribe to it?

    - by Ryan Peschel
    Event Handler public void DeliverEvent(object sender, EventArgs e) { } #1: This Works public void StartListening(Button source) { source.Click += DeliverEvent; } #2: And so does this.. public void StartListening(EventHandler eventHandler) { eventHandler += DeliverEvent; } But in #2, you cannot call the method because if you try something like this: StartListening(button.Click); You get this error: The event 'System.Windows.Forms.Control.Click' can only appear on the left hand side of += or -= Is there any way around that error? I want to be able to pass the event and not the object housing the event to the StartListening method.

    Read the article

  • Get Process ID of Program Started with C# Process.Start

    - by ThaKidd
    Thanks in advance of all of your help! I am currently developing a program in C# 2010 that launches PLink (Putty) to create a SSH Tunnel. I am trying to make the program able to keep track of each tunnel that is open so a user may terminate those instances that are no longer needed. I am currently using System.Diagnostics.Process.Start to run PLink (currently Putty being used). I need to determine the PID of each plink program when it is launched so a user can terminate it at will. Question is how to do that and am I using the right .Net name space or is there something better? Code snippet: private void btnSSHTest_Click(object sender, EventArgs e) { String puttyConString; puttyConString = "-ssh -P " + cboSSHVersion.SelectedText + " -" + txtSSHPort.Text + " -pw " + txtSSHPassword.Text + " " + txtSSHUsername.Text + "@" + txtSSHHostname.Text; Process.Start("C:\\Program Files (x86)\\Putty\\putty.exe", puttyConString); }

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >