winforms

Creating New Tabs and Managing Them - Selenium

[亡魂溺海] 提交于 2021-02-17 05:24:19
问题 Here is my Code: var chromeOptions = new ChromeOptions(); chromeOptions.AddArguments("headless"); _driver = new OpenQA.Selenium.Chrome.ChromeDriver(chromeOptions); _driver.Navigate().GoToUrl(url); It will open an instance of chromedriver.exe and will navigate to the target URL. I need to navigate to other URLs with the same chromedriver.exe intance, and I need to set specific headers and cookies for each URL. How to achieve something with Selenium and ChromeDriver? 回答1: Personally, i;d do

Enable disable button on text changed in c# winform

回眸只為那壹抹淺笑 提交于 2021-02-17 02:10:07
问题 I am developing an application, in which there is a button in search box (like one in itunes). I want to enable cancel button whenever there is text in text box and disable it when text box is empty. I tried with text_changed event on textbox with the following code, but it jump over the if condition. Even sender sends me correct values but i am unable to put it into if else. private void textBox1_TextChanged(object sender, EventArgs e) { if (string.IsNullOrEmpty(sender.ToString())) { btn

comboBox2 (or any particular form item) is inaccessible due to its protection level

余生长醉 提交于 2021-02-17 02:06:13
问题 I am working on a win-forms. Currently working on the .cs class called HM_Settings.cs which works in conjunction with HM_SettingsForm . I am trying to access the variables of the form items, by declaring these global variables public Brush backgroundColor; public Brush textColor; public double timeOffset; public double dateOffset; public string title; public bool showTitle; public bool showText; public HM_SettingsForm hmf = new HM_SettingsForm(); I am trying to use the form's variables by

comboBox2 (or any particular form item) is inaccessible due to its protection level

不问归期 提交于 2021-02-17 02:03:38
问题 I am working on a win-forms. Currently working on the .cs class called HM_Settings.cs which works in conjunction with HM_SettingsForm . I am trying to access the variables of the form items, by declaring these global variables public Brush backgroundColor; public Brush textColor; public double timeOffset; public double dateOffset; public string title; public bool showTitle; public bool showText; public HM_SettingsForm hmf = new HM_SettingsForm(); I am trying to use the form's variables by

Selecting all items in a ListBox Winform Control

99封情书 提交于 2021-02-16 19:38:03
问题 I'm trying to select all items in ListBox and made this extension method for this purpose: public static void SetSelectedAllItems(this ListBox ctl) { for (int i = 0; i < ctl.Items.Count; i++) { ctl.SetSelected(i, true); } } Problem is that if I have lots of items in the ListBox, it takes a long time to accomplish this task and I can watch how the ListBox is automatically scrolling down and selecting items. Is there a way to temporary pause the update of a control, so that the task would

how do I pass an argument to a class that inherits UITypeEditor

只谈情不闲聊 提交于 2021-02-16 18:36:31
问题 I have created an editor for a property. I would however like to pass some arguments to the constructor of the editor, but I am unsure as to how to do this. FOO _foo = new foo(); [Editor(typeof(MyEditor), typeof(UITypeEditor))] public object foo { get { return _foo; } set {_foo = value;} } ~ class MyEditor: UITypeEditor { public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { //some other code return obj; } }

Create setup that run without admin privileges using VS 2015 Professional

穿精又带淫゛_ 提交于 2021-02-16 18:25:09
问题 I'm trying to create a setup file (MSI) that runs without admin privileges. for that, I've tried the bellow option. I've set InstallAlluser property to false as bellow. Also set InstallAllUsersVisible to false I've also changed Default location with [AppDataFolder] After changes above properties It still required Administrator permission to execute MSI file that created using Setup project. Can you please help me to resolve this issue. Thanks in Advance. 回答1: When you open your MSI with Orca

How to make moveable on the desktop a borderless form in c#? [duplicate]

为君一笑 提交于 2021-02-16 15:24:53
问题 This question already has answers here : Make a borderless form movable? (20 answers) Closed 8 months ago . I want to be able to move with the mouse a form without border and title bar in c#. I looked over youtube but i can't find anything that is working. Someone can help me? 回答1: You can use the form's MouseDown, Up and Move events with a conditional variable like that: private bool IsMoving; private Point LastCursorPosition; private void FormTest_MouseDown(object sender, MouseEventArgs e)

Releasing displayed pdf files in webbrowser control

泪湿孤枕 提交于 2021-02-16 13:13:11
问题 I have a webbrowser control in my winforms application to display a selected pdf file, after this i want to move the pdf file to an other location. When i trie to move the pdf file it is giving me an error that the file is in use. I tried to make the webbrowser navigate to a other page before it is moved but it still give me this error that the file is used by an other process. How can i release this pdf file so i can just move it? Disposing the webbrowser didn't do the trick. 回答1: They say

Releasing displayed pdf files in webbrowser control

北战南征 提交于 2021-02-16 13:13:10
问题 I have a webbrowser control in my winforms application to display a selected pdf file, after this i want to move the pdf file to an other location. When i trie to move the pdf file it is giving me an error that the file is in use. I tried to make the webbrowser navigate to a other page before it is moved but it still give me this error that the file is used by an other process. How can i release this pdf file so i can just move it? Disposing the webbrowser didn't do the trick. 回答1: They say