sub

Overload resolution failed because no accessible 'new' can be called without a narrowing conversion

匿名 (未验证) 提交于 2019-12-03 00:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem. I am getting this error: Overload resolution failed because no accessible 'new' can be called without a narrowing conversion. Private Sub bt_hapus_Click(sender As Object, e As EventArgs) Handles bt_hapus.Click Try Dim sqlda As New SqlClient.SqlDataAdapter("Delete from tblpasien where No_Rkm_Mds=" & Me.No_Rkm_MdsTextBox.Text, Me.KlinikGigiDataSet) sqlda.Fill(dbpasien, "tblpasien") MsgBox("Data telah berhasil dihapus") bersih() pasif() normal() Catch ex As Exception MsgBox(ex.Message) End Try End Sub All source code : Public

How do I show a running clock in Excel?

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'd like to show a clock in cell A1 of Excel 2007. I'm familiar with NOW() and TODAY() but it doesn't refresh itself every 1 minute like I want it to. You know, like a running clock. I just want the current time in h:mm to be in cell A1. Is this possible? From this clock I will do further calculations like How long has it been since I last did Activity X, Y, and Z. Thanks SO. 回答1: See the below code ( taken from this post ) Put this code in a Module in VBA (Developer Tab -> Visual Basic) Dim TimerActive As Boolean Sub StartTimer() Start

Java search for on-screen text field

匿名 (未验证) 提交于 2019-12-03 00:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to create a program that automatically searches for a text field on the screen and types a word repetitively into that text field. Is there any class that can find a text field? Or is there any way in which a text field can be found? Because I know that the Robot class can type text, I just need to either get the cursor onto the text field and use the mousePress() and mouseRelease() methods. Thanks 回答1: I can't directly give you a solution, but I messed around with some code and may be able to point you in the right

Merge two identical DataTables results in DataRowState.Modified

匿名 (未验证) 提交于 2019-12-03 00:50:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Am I wrong assuming that if two identical DataTables are merged the state of each row will be preserved? Take a look at this simple example. It creates two identical tables and merge the updated table with original table. But the returned table in original.GetChanges() is not Nothing as expected. Also, the state of each row in the original table are changed to Modified . So what am I missing? Do I really have to create my own merge method to achieve this? Public Sub Test() Dim original As DataTable = Me.CreateTableWithData() Dim updated As

How can I create an interface in VB.NET with implicit implementations

匿名 (未验证) 提交于 2019-12-03 00:50:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In C# I can create an interface, and when I use the interface the compiler knows that certain interface requirements are fulfilled by the base class. This is probably clearer with an example: interface FormInterface { void Hide(); void Show(); void SetupForm(); } public partial class Form1 : Form, FormInterface { public Form1() { InitializeComponent(); } public void SetupForm() { } } The compiler knows that Hide() and Show() are implemented in Form and the above code compiles just fine. I can't figure out how to do this in VB.NET. When I try

Find out what stage of the life cycle a control is up to in ASP.NET WebForms

匿名 (未验证) 提交于 2019-12-03 00:48:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: From the outside of a control, is it possible to find out what stage of the Page LifeCycle (Init, Load, PreRender etc), a particular control or page is up to? For example, in pseudo code: if myControl.CurrentLifeCycle == Lifecycle.Init { do something } 回答1: I'm afraid there is no builtin function to check in what Page-Lifecycle phase a Page is. It is also difficult to add this functionality without handling all events in the Page itself, because some events are protected. Therefore you could also inherit the LifeCycleListener-class from

Puppeteer wait page load after form submit

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I submit a form using the following code and i want Puppeteer to wait page load after form submit. await page.click("button[type=submit]"); //how to wait until the new page loads before taking screenshot? // i don't want this: // await page.waitFor(1*1000); //← unwanted workaround await page.screenshot({path: 'example.png'}); How to wait for page load with puppeteer? 回答1: You can wait for navigation asynchronously to avoid getting null on redirection, await Promise.all([ page.click("button[type=submit]"), page.waitForNavigation({ waitUntil:

Show the subcategories of the chosen category in Rails 4

匿名 (未验证) 提交于 2019-12-03 00:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 1. In my **view/gigs/new.html.erb i use <%= f.collection_select :category_id, Category.all, :id, :name, {prompt: "Choose a category"} %> <%= f.collection_select :subcategory_id, Subcategory.all, :id, :name, {prompt: "Choose a subcategory"} %> It creates this and when clicked the below image: From the picture above as you see depending on what category i choose,just the subcategories owned by that category are displayed. 2. In my gig controller for this to work,i wrote the below code. def update_sub_categories @cats = Subcategory.where

【贪心】赶作业

匿名 (未验证) 提交于 2019-12-03 00:42:01
题目描述 小墨老师总是不及时做作业,所以他总有很多的作业要做。每个老师都给了他一个完成作业的最后期限,如果他超过期限交作业,老师就会在他的期末评价中扣分。假设做每一门作业总是要一天。小墨老师希望你能够帮助他安排做作业的一个顺序,以便能够被扣掉的分数最少。 输入 输入包含了多个测试用例。输入的第一行是一个整数T,代表测试用例的个数。接下来的就是T个测试用例的输入。每个测试用例都从一个正整数N(1≤N≤1000)开始,代表了作业的数目。接下来有2行。第一行包含N个整数,分别代表各个作业提交的最后期限;第二行也有N个整数,即对应于各个作业超过时间提交的扣分。 输出 对每一个测试用例,应该在一行中输出最小的扣分数。 样例输入 2 3 3 3 3 10 5 1 3 1 3 1 6 2 3 样例输出 0 3 #include <iostream> #include < string > #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #include <vector> #include <queue> #include <deque> #include <map> #define range(i,a,b) for(int i=a;i<=b;++i) #define LL long long

他山之石――VBA文本框

匿名 (未验证) 提交于 2019-12-03 00:39:02
继续学习VBA! '**********************文字框控件*************** ' 一 显示 '1 多行显示 ' MultiLine 属性值为 true 时,可以多行显示文本 '2 文本框对齐 ' 左右对齐可以用 TextAlign 对齐,但上下对齐则没有相应的属性设置 '3 密码样式 ' 可以设置 passwordChar 属性来隐藏输入的内容 '4 行列超过宽度或高度时添加滚动条 ' ScrollBars 属性可以设置垂直和水平滚动条 '5 强制换行符号 ' EnterKeyBehavior 的属性值为 TRUE 时,可以强制换行.按回车即可以转到下一行. '如果用代码,可以借用回车符来实现转行 Private Sub CommandButton1_Click() TextBox2 = "excelpx" & Chr(10) & ".com" ' Cha ( 10 )换行符 End Sub '二 功能 ' 1 自动跳到一下个 tab 顺序的控件 'AutoTab属性设置为true,当文字框输入字符数大于 ' 2 锁定文本和禁用 'locked属性为true时,显示正常,可以选取,可以复制,但不能编辑。 ' enable 属性为 false 时,显示灰色,不能选取 '3 是否允许拖放复制值 ' DragBehavior 属性值为 1 时,可以进行拖放